From b8b5898c39586ac6c3b03a9c3ecc255f42bc06de Mon Sep 17 00:00:00 2001 From: Kyle Villegas <86266231+kylevillegas93@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:37:52 -0400 Subject: [PATCH] SFR-2115: Fix handling empty collection (#518) --- .env.sample | 2 +- CHANGELOG.md | 1 + src/components/Collection/Collection.tsx | 15 ++++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.env.sample b/.env.sample index b94074f2..40167350 100644 --- a/.env.sample +++ b/.env.sample @@ -2,7 +2,7 @@ APP_ENV=development # API ENDPOINT -API_URL=http://drb-api-qa.nypl.org +API_URL=https://drb-api-qa.nypl.org # PDF PROXY ENDPOINT # In development, refer to the instructions here to use the proxy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 28ff6edb..1b14f993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Fix error when collections are empty +- Fix error when a collection is empty ## [0.18.2] diff --git a/src/components/Collection/Collection.tsx b/src/components/Collection/Collection.tsx index 617b2640..e819b03d 100644 --- a/src/components/Collection/Collection.tsx +++ b/src/components/Collection/Collection.tsx @@ -177,11 +177,16 @@ const Collection: React.FC<{ - {publications.map((pub, c) => { - return ( - - ); - })} + {publications + ? publications.map((pub, c) => { + return ( + + ); + }) + : null}