X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c324b64f3b26e79b4640b6f0cf55671f1a261bca..d0611f387f0ec0163fc8f6053a7715bc3d592700:/src/services/common-service/trashable-resource-service.ts diff --git a/src/services/common-service/trashable-resource-service.ts b/src/services/common-service/trashable-resource-service.ts index 633b2fbd..4d6b130b 100644 --- a/src/services/common-service/trashable-resource-service.ts +++ b/src/services/common-service/trashable-resource-service.ts @@ -2,22 +2,22 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as _ from "lodash"; +import { snakeCase } from "lodash"; import { AxiosInstance } from "axios"; -import { TrashableResource } from "src/models/resource"; -import { CommonResourceService } from "~/services/common-service/common-resource-service"; -import { ApiActions } from "~/services/api/api-actions"; +import { TrashableResource } from "models/resource"; +import { CommonResourceService } from "services/common-service/common-resource-service"; +import { ApiActions } from "services/api/api-actions"; export class TrashableResourceService extends CommonResourceService { - constructor(serverApi: AxiosInstance, resourceType: string, actions: ApiActions) { - super(serverApi, resourceType, actions); + constructor(serverApi: AxiosInstance, resourceType: string, actions: ApiActions, readOnlyFields: string[] = []) { + super(serverApi, resourceType, actions, readOnlyFields); } trash(uuid: string): Promise { return CommonResourceService.defaultResponse( this.serverApi - .post(this.resourceType + `${uuid}/trash`), + .post(this.resourceType + `/${uuid}/trash`), this.actions ); } @@ -28,8 +28,8 @@ export class TrashableResourceService extends Commo }; return CommonResourceService.defaultResponse( this.serverApi - .post(this.resourceType + `${uuid}/untrash`, { - params: CommonResourceService.mapKeys(_.snakeCase)(params) + .post(this.resourceType + `/${uuid}/untrash`, { + params: CommonResourceService.mapKeys(snakeCase)(params) }), this.actions );