Feature/request type access all requests (#22)
Tests / frontend-test (push) Successful in 1m24s
Tests / frontend-test (push) Successful in 1m24s
Co-authored-by: gorbenko.pavel <gorbenko.pavel@tansu.kz> Reviewed-on: http://git.tnsu.kz/timur.gorodetskiy/request-portal/pulls/22
This commit was merged in pull request #22.
This commit is contained in:
@@ -147,6 +147,28 @@ export async function getRequestTypeIdByPageUrl(context: WebPartContext, pageUrl
|
||||
return found.id;
|
||||
}
|
||||
|
||||
// GET /api/request-type-access/{requestTypeId}/emails — email'ы, кому в
|
||||
// админке approval-route выдан доступ видеть ВСЕ заявки этого типа (не только
|
||||
// свои). Тот же эндпоинт дёргает и Power Automate — здесь просто ещё один
|
||||
// потребитель.
|
||||
export async function getRequestTypeAccessEmails(
|
||||
context: WebPartContext,
|
||||
requestTypeId: number
|
||||
): Promise<string[]> {
|
||||
return withNetworkRetry(async () => {
|
||||
const c = await client(context);
|
||||
const response: HttpClientResponse = await c.get(
|
||||
`${getApprovalApiBaseUrl()}/api/request-type-access/${requestTypeId}/emails`,
|
||||
AadHttpClient.configurations.v1
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(`request-type-access/${requestTypeId}/emails: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
const body: IApiResponse<string[]> = await response.json();
|
||||
return body.data ?? [];
|
||||
});
|
||||
}
|
||||
|
||||
// POST /api/template-routes/resolve — планируемый маршрут для типа заявки и
|
||||
// пользователя. Бэкенд сам подставляет исполнителей шага (executorEmail/position)
|
||||
// по ролям исходя из userEmail. Параметр status выбирает ФАЗУ маршрута:
|
||||
|
||||
Reference in New Issue
Block a user