export class TrashableResourceService<T extends TrashableResource> extends CommonResourceService<T> {
- 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<T> {
return CommonResourceService.defaultResponse(
this.serverApi
- .post(this.resourceType + `${uuid}/trash`),
+ .post(this.resourceType + `/${uuid}/trash`),
this.actions
);
}
};
return CommonResourceService.defaultResponse(
this.serverApi
- .post(this.resourceType + `${uuid}/untrash`, {
+ .post(this.resourceType + `/${uuid}/untrash`, {
params: CommonResourceService.mapKeys(_.snakeCase)(params)
}),
this.actions