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