Skip to content

Commit

Permalink
Pull Request code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
TyroneAEM committed Feb 26, 2024
1 parent 40e0f7f commit 495779c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export async function getCollection(collectionId) {

responseBody.etag = response.headers.get('Etag');
if (responseBody.self[0].collectionMetadata.title) {
responseBody.title = responseBody.self[0].collectionMetadata.title;
responseBody.title = responseBody.self[0].collectionMetadata?.title ?? '';
} else {
responseBody.title = '';
}
Expand Down Expand Up @@ -272,8 +272,8 @@ export async function searchListCollection(limit = undefined, page = 0) {
nbPages: responseBody.results[0].nbPages,
items: responseBody.results[0].hits.map(hit => ({
id: hit.collectionId,
title: hit.collectionMetadata.metadata ? hit.collectionMetadata.metadata.title : hit.collectionMetadata.title,
description: hit.collectionMetadata.metadata ? hit.collectionMetadata.metadata.description : hit.collectionMetadata.description
title: hit.collectionMetadata.metadata?.title ?? hit.collectionMetadata.title,
description: hit.collectionMetadata.metadata?.description ?? hit.collectionMetadata.description
}))
};

Expand Down

0 comments on commit 495779c

Please sign in to comment.