fix: association destroy with individualHooks

This commit is contained in:
chenos 2020-12-15 22:45:35 +08:00
parent b2801a00dc
commit 1aa7ee65ab

View File

@ -337,7 +337,8 @@ export async function destroy(ctx: Context, next: Next) {
// @ts-ignore // @ts-ignore
ctx.body = await TargetModel.destroy({ ctx.body = await TargetModel.destroy({
where: { [primaryKey]: { [Op.in]: models.map(item => item[primaryKey]) } }, where: { [primaryKey]: { [Op.in]: models.map(item => item[primaryKey]) } },
...commonOptions ...commonOptions,
individualHooks: true,
}); });
} }
} else { } else {