Fix searchReferencesBySourceCodes
This commit is contained in:
parent
a4d6fc9913
commit
87786da9d4
|
@ -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,
|
||||
},
|
||||
})),
|
||||
|
|
Loading…
Reference in New Issue