Skip to content

Commit

Permalink
backend: fix sequelize syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
nghiamphan committed Aug 15, 2024
1 parent 4c7055a commit 2fa619f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/controllers/movies.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ router.post('/advanced-search', async (req, res) => {
whereCondition.imdbVotes = {
...whereCondition.imdbVotes,
[Op.and]: [
...(whereCondition.imdbVotes[Op.and] || [{ [Op.ne]: 'N/A' }]),
...(whereCondition.imdbVotes || [{ [Op.ne]: 'N/A' }]),
literal(`CAST(REPLACE(imdb_votes, ',', '') AS INTEGER) <= ${imdbVotesMax}`),
],
}
Expand All @@ -240,7 +240,7 @@ router.post('/advanced-search', async (req, res) => {
whereCondition.imdbRating = {
...whereCondition.imdbRating,
[Op.and]: [
...(whereCondition.imdbRating[Op.and] || [{ [Op.ne]: 'N/A' }]),
...(whereCondition.imdbRating || [{ [Op.ne]: 'N/A' }]),
literal(`CAST(imdb_rating AS FLOAT) <= ${imdbRatingMax}`),
],
}
Expand Down

0 comments on commit 2fa619f

Please sign in to comment.