Merge pull request #938 from Tria-plc/freight/fix/seeder

fix: orgs size
This commit is contained in:
Nathnael Wondisha
2026-07-23 15:04:04 +03:00
committed by GitHub

View File

@@ -37,7 +37,7 @@ export enum FilterEnum {
}
export const getOrganizations = async (
params?: OrgQueryParams
params?: OrgQueryParams,
): Promise<AxiosResponse> => {
return axiosInstance.get("/organizations/filter", {
...{ headers: withHeaders() },
@@ -45,29 +45,27 @@ export const getOrganizations = async (
});
};
export const getMyAdminOrganizations = async (): Promise<AxiosResponse> => {
//my-admin-organizations
return axiosInstance.get("/organizations/with-admin-flag", {
headers: withHeaders(),
});
};
export const getOrganizationsWithAdminFlag = async (
params?: OrgQueryParams
params?: OrgQueryParams,
): Promise<AxiosResponse> => {
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<AxiosResponse> => {
return axiosInstance.get(`/organizations/${id}`, { headers: withHeaders() });
};
export const getChildren = async (
id: string | number
id: string | number,
): Promise<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
// 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<AxiosResponse> => {
return axiosInstance.post("/organizations", data, { headers: withHeaders() });
};
export const activateOrganization = async (
id: string | number
id: string | number,
): Promise<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
return axiosInstance.patch(`/organizations/${id}/restore`, null, {
headers: withHeaders(),
@@ -171,20 +169,20 @@ export const getDocumentRequirements = async (): Promise<AxiosResponse> => {
});
};
export const getDocumentRequirementsById = async (
id: string
id: string,
): Promise<AxiosResponse> => {
return axiosInstance.get(`/documentary-requirements/${id}`, {
headers: withHeaders(),
});
};
export const getDocumentRequirementsByFilter = async (
filter: FilterEnum
filter: FilterEnum,
): Promise<AxiosResponse> => {
return axiosInstance.get(`/documentary-requirements/${filter}/type`);
};
export const postDocumentRequirements = async (
data: DocumentRequirementDto
data: DocumentRequirementDto,
): Promise<AxiosResponse> => {
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<AxiosResponse> => {
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<AxiosResponse> => {
return axiosInstance.get(`/employees/archived/${unitId}/with-unit`, {
headers: withHeaders(),