X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/019459c71713b979cb4cc34ec3a91a947d2c235a..13bf073c77ca9fcf75ebd31098a9bf538e96c9c9:/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 0c99e7d4be..70c1df0e2b 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;