Convert GraphQL params to one level-deep object

This commit is contained in:
Kamal Bennani 2018-09-14 00:33:18 +02:00
parent 4c3d5da8ee
commit 382f52a2e8
No known key found for this signature in database
GPG Key ID: 4513063CDB1A1C25

View File

@ -398,7 +398,7 @@ module.exports = {
queryOpts.skip = convertedParams.start;
switch (association.nature) {
case 'manyToMany': {
case 'manyToMany':
if (association.dominant) {
const arrayOfIds = (obj[association.alias] || []).map(
related => {
@ -413,10 +413,9 @@ module.exports = {
[ref.primaryKey]: arrayOfIds,
...where.where,
}).where;
break;
}
break;
// falls through
}
default:
// Where.
queryOpts.query = strapi.utils.models.convertParams(name, {