Skip to content

Commit

Permalink
Merge pull request #10 from NYPL-discovery/temporary-barcode-override…
Browse files Browse the repository at this point in the history
…-for-qa

Temporary barcode override for qa
  • Loading branch information
nonword authored Sep 16, 2019
2 parents 815d026 + 5c266c5 commit f73595a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,31 @@ app.get('/api/v0.1/recap/nypl-bibs', (req, res, next) => {
.then((bibIds) => {
return dataApi.getBibsAndItemsByBibId(bibIds, barcode, includeFullBibTree)
})
// BEGIN: TEMPORARY overide to test mixed-bib split
// Essentially: When barcode is one of the three we're testing, override
// item and bib ids to emulate "migrating" item out of a mixed bib into a
// new bib
// ( https://jira.nypl.org/browse/SCC-1531 )
.then((bibsAndItems) => {
let [bibs, items] = bibsAndItems

// These are the three barcodes recently deleted from UAT:
const overrideBibItemIdForMixedBibSplitTesting = [
'33433057523213',
'33433016121497',
'33433035102635'
]

if (overrideBibItemIdForMixedBibSplitTesting.indexOf(barcode) >= 0) {
// Add 999 suffix to item and bib ids:
items[0].id = `${items[0].id}999`
items[0].bibIds = items[0].bibIds.map((bibId) => `${bibId}999`)
bibs[0].id = `${bibs[0].id}999`
}

return [bibs, items]
})
// END: TEMPORARY overide to test mixed-bib split
// Format as scsb xml:
.then((bibsAndItems) => {
let [bibs, items] = bibsAndItems
Expand Down

0 comments on commit f73595a

Please sign in to comment.