- updated functionality of downloading company delegation;

This commit is contained in:
Vitalii Kiiko
2024-12-06 09:22:25 +01:00
parent 0f54ce6bd9
commit 1ad1cc19bc
3 changed files with 7 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ const DownloadCompanyDelegation = ({ applicationId = 0 }) => {
const getDellegaCallback = (data) => {
if (data.data) {
setDelega([data.data]);
setDelega(data.data);
}
setLoading(false);
}
@@ -32,7 +32,7 @@ const DownloadCompanyDelegation = ({ applicationId = 0 }) => {
useEffect(() => {
setLoading(true);
CompanyService.getCompanyDelega(0, getDellegaCallback, errDellegaCallback, [
CompanyService.getCompanyDelega(getDellegaCallback, errDellegaCallback, [
['applicationId', applicationId]
]);
}, [])

View File

@@ -341,7 +341,9 @@ const ProfileCompany = () => {
useEffect(() => {
if (formInitialData.id) {
storeSet.main.setAsyncRequest();
CompanyService.getCompanyDelega(formInitialData.id, getDellegaCallback, errDellegaCallback);
CompanyService.getCompanyDelega(getDellegaCallback, errDellegaCallback, [
['companyId', formInitialData.id]
]);
}
}, [formInitialData])

View File

@@ -20,8 +20,8 @@ export default class CompanyService {
NetworkService.get(`${API_BASE_URL}/company/user/${id}`, callback, errCallback);
};
static getCompanyDelega = (id, callback, errCallback) => {
NetworkService.get(`${API_BASE_URL}/company/${id}/delegation`, callback, errCallback);
static getCompanyDelega = (callback, errCallback, queryParams) => {
NetworkService.get(`${API_BASE_URL}/company/delegation`, callback, errCallback, queryParams);
};
static downloadCompanyDelega = (id, body, callback, errCallback) => {