From c63ba4011d124c9efee4e4f1cd6568d4eb8a8d23 Mon Sep 17 00:00:00 2001 From: Michal Klobukowski Date: Mon, 2 Jul 2018 16:16:10 +0200 Subject: [PATCH] Apply fixes according to code review comments Feature #13702 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- src/common/api/common-resource-service.ts | 12 ++++++------ src/services/groups-service/groups-service.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/api/common-resource-service.ts b/src/common/api/common-resource-service.ts index e49d2a0b..93fc000e 100644 --- a/src/common/api/common-resource-service.ts +++ b/src/common/api/common-resource-service.ts @@ -39,9 +39,6 @@ export interface ListResults { export default class CommonResourceService { - serverApi: AxiosInstance; - resourceType: string; - static mapResponseKeys = (response: any): Promise => CommonResourceService.mapKeys(_.camelCase)(response.data) @@ -63,9 +60,12 @@ export default class CommonResourceService { } } + protected serverApi: AxiosInstance; + protected resourceType: string; + constructor(serverApi: AxiosInstance, resourceType: string) { this.serverApi = serverApi; - this.resourceType = "/" + resourceType; + this.resourceType = '/' + resourceType + '/'; } create() { @@ -74,13 +74,13 @@ export default class CommonResourceService { delete(uuid: string): Promise { return this.serverApi - .delete(this.resourceType + "/" + uuid) + .delete(this.resourceType + uuid) .then(CommonResourceService.mapResponseKeys); } get(uuid: string) { return this.serverApi - .get(this.resourceType + "/" + uuid) + .get(this.resourceType + uuid) .then(CommonResourceService.mapResponseKeys); } diff --git a/src/services/groups-service/groups-service.ts b/src/services/groups-service/groups-service.ts index 9016714b..f230c70f 100644 --- a/src/services/groups-service/groups-service.ts +++ b/src/services/groups-service/groups-service.ts @@ -41,7 +41,7 @@ export default class GroupsService extends CommonResourceService order: order ? order.get() : undefined }; return this.serverApi - .get(this.resourceType + `/${uuid}/contents`, { + .get(this.resourceType + `${uuid}/contents/`, { params: CommonResourceService.mapKeys(_.snakeCase)(params) }) .then(CommonResourceService.mapResponseKeys); -- 2.30.2