fixed entry deletion if params contains associations

This commit is contained in:
Veit Bjarsch 2020-01-06 02:29:47 +01:00
parent 6f8d3917b0
commit 31e6d08b66

View File

@ -177,7 +177,9 @@ module.exports = function createQueryBuilder({ model, modelKey, strapi }) {
const runDelete = async trx => {
await deleteComponents(entry, { transacting: trx });
await model.where(params).destroy({ transacting: trx, require: false });
await model
.where({ id: entry.id })
.destroy({ transacting: trx, require: false });
return entry.toJSON();
};