Fix searchReferencesBySourceCodes

This commit is contained in:
Robbie Antenesse 2020-07-28 10:53:21 -06:00
parent a4d6fc9913
commit 87786da9d4
1 changed files with 3 additions and 3 deletions

View File

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