Skip to content

Commit

Permalink
Avoid to loose relationship when editing from the many side
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelsicoko committed May 3, 2018
1 parent 750167a commit c67e2ef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}));
});
Expand All @@ -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
}));
});
Expand Down

0 comments on commit c67e2ef

Please sign in to comment.