Merge branch 'master' of github.com:strapi/strapi into upload/bookshelf

This commit is contained in:
Aurelsicoko 2018-05-02 17:08:07 +02:00
commit 2fe530e334
2 changed files with 15 additions and 2 deletions

View File

@ -92,11 +92,16 @@ module.exports = {
const entry = request.toJSON ? request.toJSON() : request;
const relations = this.associations.reduce((acc, association) => {
acc[association.alias] = params.values[association.alias];
return acc;
}, {});
return module.exports.update.call(this, {
[this.primaryKey]: entry[this.primaryKey],
values: _.assign({
id: entry[this.primaryKey]
}, params.values, entry)
}, relations)
});
},

View File

@ -46,11 +46,19 @@ module.exports = {
const entry = request.toJSON ? request.toJSON() : request;
const relations = this.associations.reduce((acc, association) => {
if (params.values[association.alias]) {
acc[association.alias] = params.values[association.alias];
}
return acc;
}, {});
return module.exports.update.call(this, {
[this.primaryKey]: entry[this.primaryKey],
values: _.assign({
id: entry[this.primaryKey]
}, params.values, entry)
}, relations)
});
},