17337: Added another edge case handling
[arvados-workbench2.git] / src / services / user-service / user-service.ts
index cd8b6a47c0bf8ca6e5cabfb685dd9b473f8f512d..d8c7fe3d94f24d6a9f276947dc58a56ef11c9c81 100644 (file)
@@ -5,10 +5,26 @@
 import { AxiosInstance } from "axios";
 import { CommonResourceService } from "~/services/common-service/common-resource-service";
 import { UserResource } from "~/models/user";
-import { ProgressFn } from "~/services/api/api-progress";
+import { ApiActions } from "~/services/api/api-actions";
 
 export class UserService extends CommonResourceService<UserResource> {
-    constructor(serverApi: AxiosInstance, progressFn: ProgressFn) {
-        super(serverApi, "users", progressFn);
+    constructor(serverApi: AxiosInstance, actions: ApiActions) {
+        super(serverApi, "users", actions);
+    }
+
+    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
+        );
     }
 }