add API for user collections

This commit is contained in:
Kyle Spearrin 2018-10-17 11:18:12 -04:00
parent 00efae2616
commit 0d8e09b3f1
2 changed files with 6 additions and 0 deletions

View File

@ -155,6 +155,7 @@ export abstract class ApiService {
organizationId: string) => Promise<any>;
getCollectionDetails: (organizationId: string, id: string) => Promise<CollectionGroupDetailsResponse>;
getUserCollections: () => Promise<ListResponse<CollectionResponse>>;
getCollections: (organizationId: string) => Promise<ListResponse<CollectionResponse>>;
getCollectionUsers: (organizationId: string, id: string) => Promise<ListResponse<CollectionUserResponse>>;
postCollection: (organizationId: string, request: CollectionRequest) => Promise<CollectionResponse>;

View File

@ -434,6 +434,11 @@ export class ApiService implements ApiServiceAbstraction {
return new CollectionGroupDetailsResponse(r);
}
async getUserCollections(): Promise<ListResponse<CollectionResponse>> {
const r = await this.send('GET', '/collections', null, true, true);
return new ListResponse(r, CollectionResponse);
}
async getCollections(organizationId: string): Promise<ListResponse<CollectionResponse>> {
const r = await this.send('GET', '/organizations/' + organizationId + '/collections', null, true, true);
return new ListResponse(r, CollectionResponse);