mirror of
https://github.com/strapi/strapi.git
synced 2025-09-18 21:08:54 +00:00
comments
This commit is contained in:
parent
62bd2b1708
commit
59b39b47b7
@ -261,9 +261,11 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
||||
return null;
|
||||
}
|
||||
|
||||
// Delete entity components first, and then the entity
|
||||
await deleteComponents(uid, entityToDelete);
|
||||
await db.query(uid).delete({ where: { id: entityToDelete.id } });
|
||||
|
||||
// Trigger webhook
|
||||
await this.emitEvent(uid, ENTRY_DELETE, entityToDelete);
|
||||
|
||||
return entityToDelete;
|
||||
@ -284,11 +286,11 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
||||
return null;
|
||||
}
|
||||
|
||||
// Delete all the entities components first and then the entities
|
||||
// Delete all the entities components first, and then the entities
|
||||
await Promise.all(entitiesToDelete.map(entity => deleteComponents(uid, entity)));
|
||||
const result = await db.query(uid).deleteMany(query);
|
||||
|
||||
// Trigger the webhook events. One for each entity
|
||||
// Trigger the webhooks. One for each entity
|
||||
await Promise.all(entitiesToDelete.map(entity => this.emitEvent(uid, ENTRY_DELETE, entity)));
|
||||
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user