mirror of
https://github.com/strapi/strapi.git
synced 2025-08-12 10:48:12 +00:00
Merge branch 'master' into bug/4104-update-url-of-settings-button-for-content-manager-plugincard
This commit is contained in:
commit
2c5ee6d41a
@ -159,7 +159,7 @@ module.exports = {
|
||||
return _.set(
|
||||
acc,
|
||||
current,
|
||||
property.map(val => val[assocModel.primaryKey] || val)
|
||||
property ? property.map(val => val[assocModel.primaryKey] || val) : property
|
||||
);
|
||||
}
|
||||
|
||||
@ -187,12 +187,12 @@ module.exports = {
|
||||
return assocModel.updateMany(
|
||||
{
|
||||
[assocModel.primaryKey]: {
|
||||
$in: property.map(
|
||||
$in: property ? property.map(
|
||||
val =>
|
||||
new mongoose.Types.ObjectId(
|
||||
val[assocModel.primaryKey] || val
|
||||
)
|
||||
),
|
||||
) : property,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -172,9 +172,7 @@ const buildAssocResolvers = (model, name, { plugin }) => {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', ref.primaryKey],
|
||||
obj[association.alias].map(val => val[ref.primaryKey] || val) ||
|
||||
[]
|
||||
);
|
||||
(obj[association.alias] ? obj[association.alias].map(val => val[ref.primaryKey] || val) : []));
|
||||
} else {
|
||||
_.set(queryOpts, ['query', association.via], obj[ref.primaryKey]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user