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, }, })),