Skip to content

Commit

Permalink
Merge pull request #249 from NYPL/SCC-3133
Browse files Browse the repository at this point in the history
Scc 3133 - honor partner ids in item route
  • Loading branch information
charmingduchess authored Jun 8, 2022
2 parents d40376a + c5a3db4 commit bbff593
Show file tree
Hide file tree
Showing 13 changed files with 794 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config/production.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCSB_URL=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAH0wewYJKoZIhvcNAQcGoG4wbAIBADBnBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDPYxpIZG6Hz0ZHQlIQIBEIA6uaSyPyQSmODwefw9OLGpxwG/87z94WCcyGQhc9SPjx3fkKKJsZFVvXAxdGAPNu5hDICTWimWu50V2A==
SCSB_URL=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHwwegYJKoZIhvcNAQcGoG0wawIBADBmBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDKPFC8wFkVM5CyT6VQIBEIA5m4eLBkpChRA//ZNEWsRqIDGZmevb/thzI03a0NiAW6VfybSAYpFthh+bj/yAk1VEEBF6r1T4A2GP
SCSB_API_KEY=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAIMwgYAGCSqGSIb3DQEHBqBzMHECAQAwbAYJKoZIhvcNAQcBMB4GCWCGSAFlAwQBLjARBAw8tglwVzGKBduDD9wCARCAP4biSz13FvZVHyQ8LKCb0+uLcKUKmzWqC5abVJI0kTmQJvjr9ViHsuP9/qj94Y8E7K96sb+fn0+HZk8So6CssA==
ELASTICSEARCH_HOST=search-discovery-api-production-wio7hqrai645zhzi2cvpitpu6q.us-east-1.es.amazonaws.com
RESOURCES_INDEX=resources-2018-04-09
Expand Down
40 changes: 39 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"devDependencies": {
"aws-sdk": "^2.1137.0",
"axios": "^0.27.2",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"md5": "^2.2.1",
Expand Down
3 changes: 1 addition & 2 deletions routes/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ module.exports = function (app) {
.catch((error) => handleError(res, error, params))
})

app.get(`/api/v${VER}/discovery/resources/:uri\-:itemUri(i[0-9]+)`, function (req, res) {
app.get(`/api/v${VER}/discovery/resources/:uri\-:itemUri([a-z]?i[0-9]+)`, function (req, res) {
var params = { uri: req.params.uri, itemUri: req.params.itemUri }

return app.resources.findByUri(params, { baseUrl: app.baseUrl }, req)
.then((responseBody) => respond(res, responseBody, params))
.catch((error) => handleError(res, error, params))
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ function disableScsbFixtures () {
const SCSBRestClient = require('../lib/scsb-recap-client')

SCSBRestClient.prototype.getItemsAvailabilityForBarcodes.restore()
if (!process.env.UPDATE_FIXTURES) {
SCSBRestClient.prototype.recapCustomerCodeByBarcode.restore()
}
}

let dataApiClient = null
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/query-0667a8df22574c02c078676eae624670.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"took": 86,
"took": 31,
"timed_out": false,
"_shards": {
"total": 3,
Expand All @@ -8,13 +8,13 @@
},
"hits": {
"total": 1,
"max_score": 28.99862,
"max_score": 29.438574,
"hits": [
{
"_index": "resources-2018-04-09",
"_type": "resource",
"_id": "b22144813",
"_score": 28.99862,
"_score": 29.438574,
"_source": {
"extent": [
"1234, [1] pages, x leaves : illustrations ;",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/query-1b3027ada46a7a31802d62a368a8fd3f.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"took": 127,
"took": 80,
"timed_out": false,
"_shards": {
"total": 3,
Expand All @@ -8,13 +8,13 @@
},
"hits": {
"total": 1,
"max_score": 14.422518,
"max_score": 14.461138,
"hits": [
{
"_index": "resources-2018-04-09",
"_type": "resource",
"_id": "b22144813",
"_score": 14.422518,
"_score": 14.461138,
"_source": {
"extent": [
"1234, [1] pages, x leaves : illustrations ;",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/query-80aab19d347fe86fa396ece2388d1349.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"took": 51,
"took": 6,
"timed_out": false,
"_shards": {
"total": 3,
Expand All @@ -8,13 +8,13 @@
},
"hits": {
"total": 1,
"max_score": 28.854097,
"max_score": 28.922276,
"hits": [
{
"_index": "resources-2018-04-09",
"_type": "resource",
"_id": "b22144813",
"_score": 28.854097,
"_score": 28.922276,
"_source": {
"extent": [
"1234, [1] pages, x leaves : illustrations ;",
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/query-ff86f33bf1c6719ea729f8e49166469a.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"took": 71,
"took": 57,
"timed_out": false,
"_shards": {
"total": 3,
Expand All @@ -8,13 +8,13 @@
},
"hits": {
"total": 1,
"max_score": 14.613467,
"max_score": 14.812041,
"hits": [
{
"_index": "resources-2018-04-09",
"_type": "resource",
"_id": "b22144813",
"_score": 14.613467,
"_score": 14.812041,
"_source": {
"extent": [
"1234, [1] pages, x leaves : illustrations ;",
Expand Down
Loading

0 comments on commit bbff593

Please sign in to comment.