Merge branch 'master' into patch-1

This commit is contained in:
Jim LAURIE 2018-11-10 12:47:01 +01:00 committed by GitHub
commit e9c847adbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,8 +398,7 @@ module.exports = {
queryOpts.skip = convertedParams.start;
switch (association.nature) {
case 'manyToMany':
if (association.dominant) {
case 'manyToMany': {
const arrayOfIds = (obj[association.alias] || []).map(
related => {
return related[ref.primaryKey] || related;
@ -416,7 +415,6 @@ module.exports = {
break;
// falls through
}
break;
default:
// Where.
queryOpts.query = strapi.utils.models.convertParams(name, {
@ -428,6 +426,14 @@ module.exports = {
}
}
if (queryOpts.hasOwnProperty('query') &&
queryOpts.query.hasOwnProperty('id') &&
queryOpts.query.id.hasOwnProperty('value') &&
Array.isArray(queryOpts.query.id.value)
){
queryOpts.query.id.symbol = 'IN';
}
const value = await (association.model
? resolvers.fetch(params, association.plugin, [])
: resolvers.fetchAll(params, { ...queryOpts, populate: [] }));