From aebc0b82bf965d3e9068e6ff82bc26facb689fa6 Mon Sep 17 00:00:00 2001 From: Vera Kahn Date: Thu, 19 Dec 2024 16:26:46 -0500 Subject: [PATCH] make spec mutually exclusive with edd and physRequestable --- lib/requestability_resolver.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/requestability_resolver.js b/lib/requestability_resolver.js index ff96aef..3d43dee 100644 --- a/lib/requestability_resolver.js +++ b/lib/requestability_resolver.js @@ -27,11 +27,10 @@ class RequestabilityResolver { physRequestableCriteria = `${(deliveryInfo.deliveryLocation && deliveryInfo.deliveryLocation.length) || 0} delivery locations.` } - item.eddRequestable = !!deliveryInfo.eddRequestable - item.physRequestable = !!(deliveryInfo.deliveryLocation && - deliveryInfo.deliveryLocation.length) - item.specRequestable = this.buildSpecRequestable(item, parentBibHasFindingAid) + item.physRequestable = !!(deliveryInfo.deliveryLocation && + deliveryInfo.deliveryLocation.length) && !item.specRequestable + item.eddRequestable = !!deliveryInfo.eddRequestable && !item.specRequestable // items without barcodes should not be requestable const hasBarcode = (item.identifier || []).some((identifier) => /^(urn|bf):[bB]arcode:\w+/.test(identifier)) if (isItemNyplOwned(item) && !hasBarcode) { @@ -50,7 +49,6 @@ class RequestabilityResolver { const holdingLocation = DeliveryLocationsResolver.extractLocationCode(item) const nyplCoreLocation = DeliveryLocationsResolver.nyplCoreLocation(holdingLocation) const isSpecialCollectionsOnlyAccessType = !!(nyplCoreLocation?.collectionAccessType === 'special') - console.log(parentBibHasFindingAid) return !!item.aeonUrl || parentBibHasFindingAid || isSpecialCollectionsOnlyAccessType } }