diff --git a/src/models/view/collectionView.ts b/src/models/view/collectionView.ts index 760992ef89..622a9e4cf0 100644 --- a/src/models/view/collectionView.ts +++ b/src/models/view/collectionView.ts @@ -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; + } } }