Merge pull request #4904 from veitbjarsch/bugfix/entry-deletion

Entries should be deleted if query parameters contain associations
This commit is contained in:
Alexandre BODIN 2020-01-06 10:35:46 +01:00 committed by GitHub
commit 78120c0952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,7 +177,9 @@ module.exports = function createQueryBuilder({ model, modelKey, strapi }) {
const runDelete = async trx => { const runDelete = async trx => {
await deleteComponents(entry, { transacting: 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(); return entry.toJSON();
}; };