mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
add API for user collections
This commit is contained in:
@@ -155,6 +155,7 @@ export abstract class ApiService {
|
|||||||
organizationId: string) => Promise<any>;
|
organizationId: string) => Promise<any>;
|
||||||
|
|
||||||
getCollectionDetails: (organizationId: string, id: string) => Promise<CollectionGroupDetailsResponse>;
|
getCollectionDetails: (organizationId: string, id: string) => Promise<CollectionGroupDetailsResponse>;
|
||||||
|
getUserCollections: () => Promise<ListResponse<CollectionResponse>>;
|
||||||
getCollections: (organizationId: string) => Promise<ListResponse<CollectionResponse>>;
|
getCollections: (organizationId: string) => Promise<ListResponse<CollectionResponse>>;
|
||||||
getCollectionUsers: (organizationId: string, id: string) => Promise<ListResponse<CollectionUserResponse>>;
|
getCollectionUsers: (organizationId: string, id: string) => Promise<ListResponse<CollectionUserResponse>>;
|
||||||
postCollection: (organizationId: string, request: CollectionRequest) => Promise<CollectionResponse>;
|
postCollection: (organizationId: string, request: CollectionRequest) => Promise<CollectionResponse>;
|
||||||
|
|||||||
@@ -434,6 +434,11 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
return new CollectionGroupDetailsResponse(r);
|
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>> {
|
async getCollections(organizationId: string): Promise<ListResponse<CollectionResponse>> {
|
||||||
const r = await this.send('GET', '/organizations/' + organizationId + '/collections', null, true, true);
|
const r = await this.send('GET', '/organizations/' + organizationId + '/collections', null, true, true);
|
||||||
return new ListResponse(r, CollectionResponse);
|
return new ListResponse(r, CollectionResponse);
|
||||||
|
|||||||
Reference in New Issue
Block a user