use _.castArray instead, it'll only cast the value to an array if it's not the case already

This commit is contained in:
Sajjad Shirazy 2019-02-04 12:20:17 +03:30
parent 2090ae761e
commit dfead41387

View File

@ -1107,14 +1107,14 @@ module.exports = function(strapi) {
result.key = `where.${key}`; result.key = `where.${key}`;
result.value = { result.value = {
symbol: 'IN', symbol: 'IN',
value: _.isArray(value) ? value : [value], value: _.castArray(value),
}; };
break; break;
case '_nin': case '_nin':
result.key = `where.${key}`; result.key = `where.${key}`;
result.value = { result.value = {
symbol: 'NOT IN', symbol: 'NOT IN',
value: _.isArray(value) ? value : [value], value: _.castArray(value),
}; };
break; break;
default: default: