From 2b8ffea494a82aef30a7b0ee741f5f986bd027cc Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 17 Oct 2018 22:18:28 -0400 Subject: [PATCH] put collection users apis --- src/abstractions/api.service.ts | 2 ++ src/services/api.service.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index 046e6226b8..a2e5f48542 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -31,6 +31,7 @@ import { PaymentRequest } from '../models/request/paymentRequest'; import { PreloginRequest } from '../models/request/preloginRequest'; import { RegisterRequest } from '../models/request/registerRequest'; import { SeatRequest } from '../models/request/seatRequest'; +import { SelectionReadOnlyRequest } from '../models/request/selectionReadOnlyRequest'; import { StorageRequest } from '../models/request/storageRequest'; import { TokenRequest } from '../models/request/tokenRequest'; import { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest'; @@ -159,6 +160,7 @@ export abstract class ApiService { getCollections: (organizationId: string) => Promise>; getCollectionUsers: (organizationId: string, id: string) => Promise>; postCollection: (organizationId: string, request: CollectionRequest) => Promise; + putCollectionUsers: (organizationId: string, id: string, request: SelectionReadOnlyRequest[]) => Promise; putCollection: (organizationId: string, id: string, request: CollectionRequest) => Promise; deleteCollection: (organizationId: string, id: string) => Promise; deleteCollectionUser: (organizationId: string, id: string, organizationUserId: string) => Promise; diff --git a/src/services/api.service.ts b/src/services/api.service.ts index b3ad4b03ba..a7b6f530c8 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -37,6 +37,7 @@ import { PaymentRequest } from '../models/request/paymentRequest'; import { PreloginRequest } from '../models/request/preloginRequest'; import { RegisterRequest } from '../models/request/registerRequest'; import { SeatRequest } from '../models/request/seatRequest'; +import { SelectionReadOnlyRequest } from '../models/request/selectionReadOnlyRequest'; import { StorageRequest } from '../models/request/storageRequest'; import { TokenRequest } from '../models/request/tokenRequest'; import { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest'; @@ -461,6 +462,11 @@ export class ApiService implements ApiServiceAbstraction { return new CollectionResponse(r); } + async putCollectionUsers(organizationId: string, id: string, request: SelectionReadOnlyRequest[]): Promise { + await this.send('PUT', '/organizations/' + organizationId + '/collections/' + id + '/users', + request, true, false); + } + deleteCollection(organizationId: string, id: string): Promise { return this.send('DELETE', '/organizations/' + organizationId + '/collections/' + id, null, true, false); }