mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Fix conflict
This commit is contained in:
commit
b541e6cc4f
@ -36,7 +36,7 @@ module.exports = {
|
||||
} catch (e) {
|
||||
// Collection undefined try to get the collection based on collectionIdentity
|
||||
if (typeof strapi !== 'undefined') {
|
||||
collection = _.get(strapi.bookshelf.collections, collectionIdentity);
|
||||
collection = _.get(strapi, `bookshelf.collections.${collectionIdentity}`);
|
||||
}
|
||||
|
||||
// Impossible to match collectionIdentity before, try to use idAttribute
|
||||
|
||||
@ -67,7 +67,7 @@ module.exports = {
|
||||
update: async function (params) {
|
||||
const virtualFields = [];
|
||||
const response = await module.exports.findOne.call(this, params);
|
||||
|
||||
|
||||
// Only update fields which are on this document.
|
||||
const values = params.parseRelationships === false ? params.values : Object.keys(JSON.parse(JSON.stringify(params.values))).reduce((acc, current) => {
|
||||
const association = this.associations.filter(x => x.alias === current)[0];
|
||||
@ -211,6 +211,7 @@ module.exports = {
|
||||
switch (association.nature) {
|
||||
case 'oneToOne':
|
||||
case 'oneToMany':
|
||||
case 'manyToOne':
|
||||
return module.exports.update.call(this, params);
|
||||
case 'manyToMany':
|
||||
return this.forge({
|
||||
@ -233,6 +234,7 @@ module.exports = {
|
||||
switch (association.nature) {
|
||||
case 'oneToOne':
|
||||
case 'oneToMany':
|
||||
case 'manyToOne':
|
||||
return module.exports.update.call(this, params);
|
||||
case 'manyToMany':
|
||||
return this.forge({
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
"type": "integer"
|
||||
},
|
||||
"posts": {
|
||||
"collection": "post",
|
||||
"via": "author"
|
||||
"collection": "post",
|
||||
"via": "author"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user