Handle bookshelf fix #1490

This commit is contained in:
Jim LAURIE 2018-08-31 11:41:21 +02:00
parent cfda76aec9
commit bb38f2a42c

View File

@ -97,7 +97,7 @@ module.exports = {
module.exports.findOne module.exports.findOne
.call(model, { [model.primaryKey]: recordId }, [details.via]) .call(model, { [model.primaryKey]: recordId }, [details.via])
.then(record => { .then(record => {
if (record && _.isObject(record[details.via])) { if (record && _.isObject(record[details.via]) && record.id !== record[details.via][current]) {
return module.exports.update.call(this, { return module.exports.update.call(this, {
id: getValuePrimaryKey(record[details.via], model.primaryKey), id: getValuePrimaryKey(record[details.via], model.primaryKey),
values: { values: {