mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
fixed entry deletion if params contains associations
This commit is contained in:
parent
6f8d3917b0
commit
31e6d08b66
@ -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();
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user