From d49182597e3f29d9790a4b918ba0ab6583922ab6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 17 Oct 2018 17:31:13 -0400 Subject: [PATCH] new collection user api endpoint --- src/abstractions/api.service.ts | 4 ++-- src/models/response/collectionUserResponse.ts | 22 ------------------- src/services/api.service.ts | 6 ++--- 3 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 src/models/response/collectionUserResponse.ts diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index e72140982f..046e6226b8 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -55,7 +55,6 @@ import { CollectionGroupDetailsResponse, CollectionResponse, } from '../models/response/collectionResponse'; -import { CollectionUserResponse } from '../models/response/collectionUserResponse'; import { DomainsResponse } from '../models/response/domainsResponse'; import { EventResponse } from '../models/response/eventResponse'; import { FolderResponse } from '../models/response/folderResponse'; @@ -75,6 +74,7 @@ import { } from '../models/response/organizationUserResponse'; import { PreloginResponse } from '../models/response/preloginResponse'; import { ProfileResponse } from '../models/response/profileResponse'; +import { SelectionReadOnlyResponse } from '../models/response/selectionReadOnlyResponse'; import { SyncResponse } from '../models/response/syncResponse'; import { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse'; import { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse'; @@ -157,7 +157,7 @@ export abstract class ApiService { getCollectionDetails: (organizationId: string, id: string) => Promise; getUserCollections: () => Promise>; getCollections: (organizationId: string) => Promise>; - getCollectionUsers: (organizationId: string, id: string) => Promise>; + getCollectionUsers: (organizationId: string, id: string) => Promise>; postCollection: (organizationId: string, request: CollectionRequest) => Promise; putCollection: (organizationId: string, id: string, request: CollectionRequest) => Promise; deleteCollection: (organizationId: string, id: string) => Promise; diff --git a/src/models/response/collectionUserResponse.ts b/src/models/response/collectionUserResponse.ts deleted file mode 100644 index ea36e473e6..0000000000 --- a/src/models/response/collectionUserResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType'; -import { OrganizationUserType } from '../../enums/organizationUserType'; - -export class CollectionUserResponse { - organizationUserId: string; - accessAll: boolean; - name: string; - email: string; - type: OrganizationUserType; - status: OrganizationUserStatusType; - readOnly: boolean; - - constructor(response: any) { - this.organizationUserId = response.OrganizationUserId; - this.accessAll = response.AccessAll; - this.name = response.Name; - this.email = response.Email; - this.type = response.Type; - this.status = response.Status; - this.readOnly = response.ReadOnly; - } -} diff --git a/src/services/api.service.ts b/src/services/api.service.ts index a0b9c816e7..b3ad4b03ba 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -61,7 +61,6 @@ import { CollectionGroupDetailsResponse, CollectionResponse, } from '../models/response/collectionResponse'; -import { CollectionUserResponse } from '../models/response/collectionUserResponse'; import { DomainsResponse } from '../models/response/domainsResponse'; import { ErrorResponse } from '../models/response/errorResponse'; import { EventResponse } from '../models/response/eventResponse'; @@ -82,6 +81,7 @@ import { } from '../models/response/organizationUserResponse'; import { PreloginResponse } from '../models/response/preloginResponse'; import { ProfileResponse } from '../models/response/profileResponse'; +import { SelectionReadOnlyResponse } from '../models/response/selectionReadOnlyResponse'; import { SyncResponse } from '../models/response/syncResponse'; import { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse'; import { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse'; @@ -444,10 +444,10 @@ export class ApiService implements ApiServiceAbstraction { return new ListResponse(r, CollectionResponse); } - async getCollectionUsers(organizationId: string, id: string): Promise> { + async getCollectionUsers(organizationId: string, id: string): Promise> { const r = await this.send('GET', '/organizations/' + organizationId + '/collections/' + id + '/users', null, true, true); - return new ListResponse(r, CollectionUserResponse); + return new ListResponse(r, SelectionReadOnlyResponse); } async postCollection(organizationId: string, request: CollectionRequest): Promise {