From 79cbddb7e6b0471a6f9a818175b8f6c6ebcc4472 Mon Sep 17 00:00:00 2001 From: ghost2023 Date: Thu, 23 Jul 2026 15:00:25 +0300 Subject: [PATCH] fix: orgs size --- .../shared/services/organizationsService.ts | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/apps/edr-freight-web/backoffice/src/shared/services/organizationsService.ts b/apps/edr-freight-web/backoffice/src/shared/services/organizationsService.ts index 3a560a08d..f0bd42337 100644 --- a/apps/edr-freight-web/backoffice/src/shared/services/organizationsService.ts +++ b/apps/edr-freight-web/backoffice/src/shared/services/organizationsService.ts @@ -37,7 +37,7 @@ export enum FilterEnum { } export const getOrganizations = async ( - params?: OrgQueryParams + params?: OrgQueryParams, ): Promise => { return axiosInstance.get("/organizations/filter", { ...{ headers: withHeaders() }, @@ -45,29 +45,27 @@ export const getOrganizations = async ( }); }; -export const getMyAdminOrganizations = async (): Promise => { - //my-admin-organizations - return axiosInstance.get("/organizations/with-admin-flag", { - headers: withHeaders(), - }); -}; export const getOrganizationsWithAdminFlag = async ( - params?: OrgQueryParams + params?: OrgQueryParams, ): Promise => { return axiosInstance.get("/organizations/with-admin-flag", { ...{ headers: withHeaders() }, - params, + params: { + take: 100, + ...params, + }, }); }; +export const getMyAdminOrganizations = getOrganizationsWithAdminFlag; export const getOrganizationById = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.get(`/organizations/${id}`, { headers: withHeaders() }); }; export const getChildren = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.get(`/organizations/${id}/children`, { headers: withHeaders(), @@ -76,7 +74,7 @@ export const getChildren = async ( export const getEmployeesUnderOrg = async ( id: string | number, - params?: OrgQueryParams + params?: OrgQueryParams, ): Promise => { return axiosInstance.get(`/organizations/current/${id}/employees`, { headers: withHeaders(), @@ -89,7 +87,7 @@ export const getEmployeesUnderOrg = async ( }; export const getEmployeeCountByOrgId = async ( - id: string | number + id: string | number, ): Promise => { // Try the endpoint from your curl example return axiosInstance.get(`/organizations/${id}/employees/count`, { @@ -98,13 +96,13 @@ export const getEmployeeCountByOrgId = async ( }; export const createOrganization = async ( - data: OrganizationPayload + data: OrganizationPayload, ): Promise => { return axiosInstance.post("/organizations", data, { headers: withHeaders() }); }; export const activateOrganization = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.patch(`/organizations/${id}/activate`, null, { headers: withHeaders(), @@ -112,7 +110,7 @@ export const activateOrganization = async ( }; export const deActivateOrganization = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.patch(`/organizations/${id}/debar`, null, { headers: withHeaders(), @@ -121,7 +119,7 @@ export const deActivateOrganization = async ( export const updateOrganization = async ( id: string | number, - data: OrganizationPayload + data: OrganizationPayload, ): Promise => { return axiosInstance.put(`/organizations/${id}`, data, { headers: withHeaders(), @@ -129,7 +127,7 @@ export const updateOrganization = async ( }; export const deleteOrganization = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.delete(`/organizations/${id}`, { headers: withHeaders(), @@ -137,7 +135,7 @@ export const deleteOrganization = async ( }; export const softDeleteOrganization = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.delete(`/organizations/${id}/soft`, { headers: withHeaders(), @@ -149,7 +147,7 @@ export const softDeleteOrganization = async ( // GET /organizations/archived // PATCH /organizations/{id}/restore export const getArchivedOrganizations = async ( - params?: OrgQueryParams + params?: OrgQueryParams, ): Promise => { return axiosInstance.get(`/organizations/archived`, { headers: withHeaders(), @@ -158,7 +156,7 @@ export const getArchivedOrganizations = async ( }; export const restoreOrganization = async ( - id: string | number + id: string | number, ): Promise => { return axiosInstance.patch(`/organizations/${id}/restore`, null, { headers: withHeaders(), @@ -171,20 +169,20 @@ export const getDocumentRequirements = async (): Promise => { }); }; export const getDocumentRequirementsById = async ( - id: string + id: string, ): Promise => { return axiosInstance.get(`/documentary-requirements/${id}`, { headers: withHeaders(), }); }; export const getDocumentRequirementsByFilter = async ( - filter: FilterEnum + filter: FilterEnum, ): Promise => { return axiosInstance.get(`/documentary-requirements/${filter}/type`); }; export const postDocumentRequirements = async ( - data: DocumentRequirementDto + data: DocumentRequirementDto, ): Promise => { return axiosInstance.post(`/documentary-requirements`, data, { headers: withHeaders(), @@ -193,7 +191,7 @@ export const postDocumentRequirements = async ( export const giveResponse = async ( id: string, - data: ResponseActionDto + data: ResponseActionDto, ): Promise => { return axiosInstance.post(`user-documents/${id}/response`, data, { headers: withHeaders(), @@ -202,7 +200,7 @@ export const giveResponse = async ( export const getArchivedUserId = async ( unitId: string, - params?: OrgQueryParams + params?: OrgQueryParams, ): Promise => { return axiosInstance.get(`/employees/archived/${unitId}/with-unit`, { headers: withHeaders(),