- updated functionality of downloading company delegation;
This commit is contained in:
@@ -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]
|
||||
]);
|
||||
}, [])
|
||||
|
||||
@@ -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])
|
||||
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user