X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e79b7364ea28b6f0719c9adf409ba1217b9ccac8..1080aac872d8c1d00b55a7291d88b704fc400813:/src/services/common-service/common-resource-service.ts diff --git a/src/services/common-service/common-resource-service.ts b/src/services/common-service/common-resource-service.ts index 0c99e7d4..70c1df0e 100644 --- a/src/services/common-service/common-resource-service.ts +++ b/src/services/common-service/common-resource-service.ts @@ -62,7 +62,7 @@ export class CommonResourceService { } } - static defaultResponse(promise: AxiosPromise, actions: ApiActions): Promise { + static defaultResponse(promise: AxiosPromise, actions: ApiActions, mapKeys = true): Promise { const reqId = uuid(); actions.progressFn(reqId, true); return promise @@ -70,7 +70,9 @@ export class CommonResourceService { actions.progressFn(reqId, false); return data; }) - .then(CommonResourceService.mapResponseKeys) + .then((response: { data: any }) => { + return mapKeys ? CommonResourceService.mapResponseKeys(response) : response.data; + }) .catch(({ response }) => { actions.progressFn(reqId, false); const errors = CommonResourceService.mapResponseKeys(response) as Errors;