18559: Add user service setup and add return type for unsetup.
authorStephen Smith <stephen@curii.com>
Wed, 2 Mar 2022 14:28:36 +0000 (09:28 -0500)
committerStephen Smith <stephen@curii.com>
Wed, 2 Mar 2022 14:46:32 +0000 (09:46 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/services/user-service/user-service.ts

index e6560c84882a26a847b11afc920a3d9da73f713e..97cb3c7112f5fb5f583d5f392437f0c9b02d4abe 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[] = []) {
@@ -24,8 +25,16 @@ export class UserService extends CommonResourceService<UserResource> {
         );
     }
 
+    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