Compare commits

..

No commits in common. "0b9e9d00facb24e5edc589106690dcd59aec5910" and "a4d6fc99133aed61f7cd8e6ed095561be3a15551" have entirely different histories.

4 changed files with 768 additions and 852 deletions

View File

@ -27,31 +27,31 @@
"sequelize-erd": "https://github.com/Alamantus/sequelize-erd.git" "sequelize-erd": "https://github.com/Alamantus/sequelize-erd.git"
}, },
"dependencies": { "dependencies": {
"autoprefixer": "^9.8.5", "autoprefixer": "^9.7.4",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"choo": "^7.1.0", "choo": "^7.1.0",
"cross-env": "^7.0.2", "cross-env": "^7.0.0",
"fastify": "^3.1.1", "fastify": "^2.11.0",
"fastify-caching": "^6.0.1", "fastify-caching": "^5.0.0",
"fastify-compress": "^3.2.2", "fastify-compress": "^2.0.0",
"fastify-cookie": "^4.0.2", "fastify-cookie": "^3.5.0",
"fastify-helmet": "^4.0.2", "fastify-helmet": "^3.0.2",
"fastify-jwt": "^2.1.2", "fastify-jwt": "^1.2.1",
"fastify-plugin": "^2.0.3", "fastify-plugin": "^1.6.0",
"fastify-static": "^3.2.0", "fastify-static": "^2.6.0",
"make-promises-safe": "^5.1.0", "make-promises-safe": "^5.1.0",
"marked": "^1.1.1", "marked": "^1.1.0",
"mysql2": "^2.1.0", "mysql2": "^2.1.0",
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"nodemailer": "^6.4.10", "nodemailer": "^6.4.2",
"parcel-bundler": "^1.12.4", "parcel-bundler": "^1.12.4",
"parcel-plugin-goodie-bag": "^2.0.0", "parcel-plugin-goodie-bag": "^2.0.0",
"pg": "^8.3.0", "pg": "^8.2.1",
"pg-hstore": "^2.3.3", "pg-hstore": "^2.3.3",
"picnic": "^6.5.2", "picnic": "^6.5.2",
"sass": "^1.26.10", "sass": "^1.25.0",
"sequelize": "^6.3.3", "sequelize": "^5.21.3",
"sharp": "^0.25.4", "sharp": "^0.25.4",
"sqlite3": "^5.0.0" "sqlite3": "^4.2.0"
} }
} }

View File

@ -48,12 +48,6 @@ class SearchController {
[fn('AVG', col('Ratings.rating')), 'averageRating'], [fn('AVG', col('Ratings.rating')), 'averageRating'],
], ],
order: [[col('totalInteractions'), 'DESC']], order: [[col('totalInteractions'), 'DESC']],
group: [
col('BookReference.id'),
col('Interactions.id'),
col('Reviews.id'),
col('Ratings.id'),
],
}; };
} }
@ -83,7 +77,7 @@ class SearchController {
let extraReferences = []; let extraReferences = [];
if (urisToCheck.length > 0) { if (urisToCheck.length > 0) {
// Need to figure this out // Need to figure this out
extraReferences = await this.searchReferencesBySourceCodes(source, urisToCheck); // extraReferences = await this.searchReferencesBySourceCodes(source, urisToCheck);
} }
return [ return [
...bookReferences, ...bookReferences,
@ -146,7 +140,7 @@ class SearchController {
const sourceJSONKey = `"${source}"`; // Enable searching withing JSON column. const sourceJSONKey = `"${source}"`; // Enable searching withing JSON column.
return await this.models.BookReference.findOne({ return await this.models.BookReference.findOne({
where: { where: {
sources: { source: {
[sourceJSONKey]: { // Where the object key is the source [sourceJSONKey]: { // Where the object key is the source
[Op.eq]: sourceId, [Op.eq]: sourceId,
}, },
@ -163,7 +157,7 @@ class SearchController {
return await this.models.BookReference.findAll({ return await this.models.BookReference.findAll({
where: { where: {
[Op.or]: sourceIds.map(sourceId => ({ [Op.or]: sourceIds.map(sourceId => ({
sources: { source: {
[sourceJSONKey]: sourceId, [sourceJSONKey]: sourceId,
}, },
})), })),

View File

@ -23,7 +23,7 @@ module.exports = sequelize => sequelize.define('Shelf', {
}, },
}, },
permissionLevel: { permissionLevel: {
type: Sequelize.INTEGER, type: Sequelize.NUMBER,
allowNull: false, allowNull: false,
defaultValue: 0, defaultValue: 0,
references: { references: {

1574
yarn.lock

File diff suppressed because it is too large Load Diff