17337: Added another edge case handling
[arvados-workbench2.git] / src / services / user-service / user-service.ts
index 3c09a87d78512439887389ccaee4d0afdc698f32..d8c7fe3d94f24d6a9f276947dc58a56ef11c9c81 100644 (file)
@@ -3,11 +3,28 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { AxiosInstance } from "axios";
-import { CommonResourceService } from "~/common/api/common-resource-service";
+import { CommonResourceService } from "~/services/common-service/common-resource-service";
 import { UserResource } from "~/models/user";
+import { ApiActions } from "~/services/api/api-actions";
 
 export class UserService extends CommonResourceService<UserResource> {
-    constructor(serverApi: AxiosInstance) {
-        super(serverApi, "users");
+    constructor(serverApi: AxiosInstance, actions: ApiActions) {
+        super(serverApi, "users", actions);
     }
-}
\ No newline at end of file
+
+    activate(uuid: string) {
+        return CommonResourceService.defaultResponse(
+            this.serverApi
+                .post(this.resourceType + `/${uuid}/activate`),
+            this.actions
+        );
+    }
+
+    unsetup(uuid: string) {
+        return CommonResourceService.defaultResponse(
+            this.serverApi
+                .post(this.resourceType + `/${uuid}/unsetup`),
+            this.actions
+        );
+    }
+}