18881: Fixes the "non-status" indication on objects that aren't processes.
[arvados-workbench2.git] / src / services / user-service / user-service.ts
index e6560c84882a26a847b11afc920a3d9da73f713e..8581b26766715fe57ce1d50657c8e9131f90daa4 100644 (file)
@@ -6,6 +6,7 @@ import { AxiosInstance } from "axios";
 import { CommonResourceService } from "services/common-service/common-resource-service";
 import { UserResource } from "models/user";
 import { ApiActions } from "services/api/api-actions";
+import { ListResults } from "services/common-service/common-service";
 
 export class UserService extends CommonResourceService<UserResource> {
     constructor(serverApi: AxiosInstance, actions: ApiActions, readOnlyFields: string[] = []) {
@@ -17,15 +18,23 @@ export class UserService extends CommonResourceService<UserResource> {
     }
 
     activate(uuid: string) {
-        return CommonResourceService.defaultResponse(
+        return CommonResourceService.defaultResponse<UserResource>(
             this.serverApi
                 .post(this.resourceType + `/${uuid}/activate`),
             this.actions
         );
     }
 
+    setup(uuid: string) {
+        return CommonResourceService.defaultResponse<ListResults<any>>(
+            this.serverApi
+                .post(this.resourceType + `/setup`, {}, { params: { uuid } }),
+            this.actions
+        );
+    }
+
     unsetup(uuid: string) {
-        return CommonResourceService.defaultResponse(
+        return CommonResourceService.defaultResponse<UserResource>(
             this.serverApi
                 .post(this.resourceType + `/${uuid}/unsetup`),
             this.actions