mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
extend ctor for collection view
This commit is contained in:
parent
971e19335f
commit
53d08067df
@ -3,6 +3,8 @@ import { View } from './view';
|
|||||||
import { Collection } from '../domain/collection';
|
import { Collection } from '../domain/collection';
|
||||||
import { ITreeNodeObject } from '../domain/treeNode';
|
import { ITreeNodeObject } from '../domain/treeNode';
|
||||||
|
|
||||||
|
import { CollectionGroupDetailsResponse } from '../response/collectionResponse';
|
||||||
|
|
||||||
export class CollectionView implements View, ITreeNodeObject {
|
export class CollectionView implements View, ITreeNodeObject {
|
||||||
id: string = null;
|
id: string = null;
|
||||||
organizationId: string = null;
|
organizationId: string = null;
|
||||||
@ -10,14 +12,16 @@ export class CollectionView implements View, ITreeNodeObject {
|
|||||||
externalId: string = null;
|
externalId: string = null;
|
||||||
readOnly: boolean = null;
|
readOnly: boolean = null;
|
||||||
|
|
||||||
constructor(c?: Collection) {
|
constructor(c?: Collection | CollectionGroupDetailsResponse) {
|
||||||
if (!c) {
|
if (!c) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.id = c.id;
|
this.id = c.id;
|
||||||
this.organizationId = c.organizationId;
|
this.organizationId = c.organizationId;
|
||||||
this.readOnly = c.readOnly;
|
|
||||||
this.externalId = c.externalId;
|
this.externalId = c.externalId;
|
||||||
|
if (c instanceof Collection) {
|
||||||
|
this.readOnly = c.readOnly;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user