mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Avoid to loose relationship when editing from the many side
This commit is contained in:
parent
750167aad4
commit
c67e2ef6d4
@ -177,7 +177,7 @@ module.exports = {
|
||||
|
||||
virtualFields.push(strapi.query(details.model || details.collection, details.plugin).addRelation({
|
||||
id: value[this.primaryKey] || value.id || value._id,
|
||||
values: value,
|
||||
values: _.pick(value, [this.primaryKey, details.via]),
|
||||
foreignKey: current
|
||||
}));
|
||||
});
|
||||
@ -191,7 +191,7 @@ module.exports = {
|
||||
|
||||
virtualFields.push(strapi.query(details.model || details.collection, details.plugin).removeRelation({
|
||||
id: value[this.primaryKey] || value.id || value._id,
|
||||
values: value,
|
||||
values: _.pick(value, [this.primaryKey, details.via]),
|
||||
foreignKey: current
|
||||
}));
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user