Merge pull request #2759 from strapi/fix-where-array

Fix ternary condition
This commit is contained in:
Jim LAURIE 2019-02-05 12:26:09 +01:00 committed by GitHub
commit 26e7b39faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ module.exports = {
_.forEach(params.where, (where, key) => { _.forEach(params.where, (where, key) => {
if (_.isArray(where.value) && where.symbol !== 'IN') { if (_.isArray(where.value) && where.symbol !== 'IN') {
for (const value in where.value) { for (const value in where.value) {
qb[value ? 'where' : 'orWhere'](key, where.symbol, where.value[value]); qb[parseInt(value) ? 'orWhere' : 'where'](key, where.symbol, where.value[value]);
} }
} else { } else {
qb.where(key, where.symbol, where.value); qb.where(key, where.symbol, where.value);