From bded5eb625e3eb8f7577ad3da54d5c3b7e543eb0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 10 Jul 2018 10:06:47 -0400 Subject: [PATCH] bug fixes in api models --- src/models/request/collectionRequest.ts | 5 ++++- src/models/response/collectionResponse.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/models/request/collectionRequest.ts b/src/models/request/collectionRequest.ts index e5f427624b..716b0acab5 100644 --- a/src/models/request/collectionRequest.ts +++ b/src/models/request/collectionRequest.ts @@ -6,7 +6,10 @@ export class CollectionRequest { name: string; groups: SelectionReadOnlyRequest[] = []; - constructor(collection: Collection) { + constructor(collection?: Collection) { + if (collection == null) { + return; + } this.name = collection.name ? collection.name.encryptedString : null; } } diff --git a/src/models/response/collectionResponse.ts b/src/models/response/collectionResponse.ts index d04304b785..14e839cf35 100644 --- a/src/models/response/collectionResponse.ts +++ b/src/models/response/collectionResponse.ts @@ -27,7 +27,7 @@ export class CollectionGroupDetailsResponse extends CollectionResponse { constructor(response: any) { super(response); if (response.Groups != null) { - this.groups = response.Collections.map((g: any) => new SelectionReadOnlyResponse(g)); + this.groups = response.Groups.map((g: any) => new SelectionReadOnlyResponse(g)); } } }