1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 02:03:39 +00:00

collection externalId

This commit is contained in:
Kyle Spearrin
2019-03-07 15:17:58 -05:00
parent 3b3b71d841
commit 79fea92b81
6 changed files with 15 additions and 1 deletions

View File

@@ -5,11 +5,13 @@ export class Collection {
const req = new Collection();
req.organizationId = '00000000-0000-0000-0000-000000000000';
req.name = 'Collection name';
req.externalId = null;
return req;
}
static toView(req: Collection, view = new CollectionView()) {
view.name = req.name;
view.externalId = req.externalId;
if (view.organizationId == null) {
view.organizationId = req.organizationId;
}
@@ -18,10 +20,12 @@ export class Collection {
organizationId: string;
name: string;
externalId: string;
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
build(o: CollectionView) {
this.organizationId = o.organizationId;
this.name = o.name;
this.externalId = o.externalId;
}
}