From becf4fde895b6ee27be9484c0caf1cc416275498 Mon Sep 17 00:00:00 2001 From: "Erin E. Sullivan" Date: Tue, 29 Oct 2024 15:50:41 -0400 Subject: [PATCH] Pulling data from workshop, and only displaying specific keys for cards. --- src/modules/browse/components/ShelfBrowse/index.js | 3 ++- src/modules/browse/components/ShelfBrowseCarousel/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/browse/components/ShelfBrowse/index.js b/src/modules/browse/components/ShelfBrowse/index.js index 60fd76e2..062c9333 100644 --- a/src/modules/browse/components/ShelfBrowse/index.js +++ b/src/modules/browse/components/ShelfBrowse/index.js @@ -51,7 +51,8 @@ const ShelfBrowse = () => { const fetchShelfData = useCallback(async () => { setShelfData('loading'); try { - const response = await fetch(`https://search.lib.umich.edu/catalog/browse/carousel?query=${callNumber}`); + // `https://search.lib.umich.edu/catalog/browse/carousel?query=${callNumber}` + const response = await fetch(`https://browse.workshop.search.lib.umich.edu/carousel?query=${callNumber}`); if (!response.ok) { throw new Error(`HTTP Error! status: ${response.status}`); } diff --git a/src/modules/browse/components/ShelfBrowseCarousel/index.js b/src/modules/browse/components/ShelfBrowseCarousel/index.js index a3ae9bae..d4778f43 100644 --- a/src/modules/browse/components/ShelfBrowseCarousel/index.js +++ b/src/modules/browse/components/ShelfBrowseCarousel/index.js @@ -105,7 +105,7 @@ const ShelfBrowseCarousel = ({ callNumber, items, itemsPerPage, setButtonAction, {currentItems.map((item, index) => { const isCurrentItem = currentItem(item); const firstOrLastItem = !isCurrentItem && ((firstPage && index === 0) || (lastPage && currentItems.length - 1 === index)); - const fields = firstOrLastItem ? ['call_number'] : Object.keys(item).slice(0, -1); + const fields = firstOrLastItem ? ['call_number'] : ['title', 'author', 'date', 'call_number']; const basePath = 'https://search.lib.umich.edu'; const anchorAttributes = firstOrLastItem ? { href: `${basePath}/catalog/browse/callnumber?query=${item.call_number}` }