Skip to content

Commit

Permalink
Pulling data from workshop, and only displaying specific keys for cards.
Browse files Browse the repository at this point in the history
  • Loading branch information
erinesullivan committed Oct 29, 2024
1 parent bc34606 commit becf4fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/modules/browse/components/ShelfBrowse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/browse/components/ShelfBrowseCarousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}` }
Expand Down

0 comments on commit becf4fd

Please sign in to comment.