- .then(CommonResourceService.mapResponseKeys)
- .catch(({ response }) => Promise.reject<Errors>(CommonResourceService.mapResponseKeys(response)));
+ .then(data => {
+ actions.progressFn(reqId, false);
+ return data;
+ })
+ .then((response: { data: any }) => {
+ return mapKeys ? CommonResourceService.mapResponseKeys(response) : response.data;
+ })
+ .catch(({ response }) => {
+ actions.progressFn(reqId, false);
+ const errors = CommonResourceService.mapResponseKeys(response) as Errors;
+ actions.errorFn(reqId, errors);
+ throw errors;
+ });