- constructor(serverApi: AxiosInstance) {
- super(serverApi, "users");
+ constructor(serverApi: AxiosInstance, actions: ApiActions, readOnlyFields: string[] = []) {
+ super(serverApi, "users", actions, readOnlyFields.concat([
+ 'fullName',
+ 'isInvited',
+ 'writableBy',
+ ]));
+ }
+
+ activate(uuid: string) {
+ 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<UserResource>(
+ this.serverApi
+ .post(this.resourceType + `/${uuid}/unsetup`),
+ this.actions
+ );