From 87786da9d49cd98028b24ad5968182052aa8b712 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Tue, 28 Jul 2020 10:53:21 -0600 Subject: [PATCH] Fix searchReferencesBySourceCodes --- server/controllers/search/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/controllers/search/index.js b/server/controllers/search/index.js index 0273faa..986e761 100644 --- a/server/controllers/search/index.js +++ b/server/controllers/search/index.js @@ -77,7 +77,7 @@ class SearchController { let extraReferences = []; if (urisToCheck.length > 0) { // Need to figure this out - // extraReferences = await this.searchReferencesBySourceCodes(source, urisToCheck); + extraReferences = await this.searchReferencesBySourceCodes(source, urisToCheck); } return [ ...bookReferences, @@ -140,7 +140,7 @@ class SearchController { const sourceJSONKey = `"${source}"`; // Enable searching withing JSON column. return await this.models.BookReference.findOne({ where: { - source: { + sources: { [sourceJSONKey]: { // Where the object key is the source [Op.eq]: sourceId, }, @@ -157,7 +157,7 @@ class SearchController { return await this.models.BookReference.findAll({ where: { [Op.or]: sourceIds.map(sourceId => ({ - source: { + sources: { [sourceJSONKey]: sourceId, }, })),