1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-20 02:01:47 +01:00

bug fixes in api models

This commit is contained in:
Kyle Spearrin 2018-07-10 10:06:47 -04:00
parent 36ab2ec78b
commit bded5eb625
2 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,10 @@ export class CollectionRequest {
name: string; name: string;
groups: SelectionReadOnlyRequest[] = []; groups: SelectionReadOnlyRequest[] = [];
constructor(collection: Collection) { constructor(collection?: Collection) {
if (collection == null) {
return;
}
this.name = collection.name ? collection.name.encryptedString : null; this.name = collection.name ? collection.name.encryptedString : null;
} }
} }

View File

@ -27,7 +27,7 @@ export class CollectionGroupDetailsResponse extends CollectionResponse {
constructor(response: any) { constructor(response: any) {
super(response); super(response);
if (response.Groups != null) { if (response.Groups != null) {
this.groups = response.Collections.map((g: any) => new SelectionReadOnlyResponse(g)); this.groups = response.Groups.map((g: any) => new SelectionReadOnlyResponse(g));
} }
} }
} }