1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

apis for groups and collections

This commit is contained in:
Kyle Spearrin
2018-07-06 12:40:43 -04:00
parent 4ae4b667ff
commit 2a526940fd
12 changed files with 198 additions and 9 deletions

View File

@@ -1,13 +1,33 @@
import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';
export class CollectionResponse {
id: string;
organizationId: string;
name: string;
readOnly: boolean;
constructor(response: any) {
this.id = response.Id;
this.organizationId = response.OrganizationId;
this.name = response.Name;
}
}
export class CollectionDetailsResponse extends CollectionResponse {
readOnly: boolean;
constructor(response: any) {
super(response);
this.readOnly = response.ReadOnly || false;
}
}
export class CollectionGroupDetailsResponse extends CollectionResponse {
groups: SelectionReadOnlyResponse[] = [];
constructor(response: any) {
super(response);
if (response.Groups != null) {
this.groups = response.Collections.map((g: any) => new SelectionReadOnlyResponse(g));
}
}
}