This commit is contained in:
rgrgogu
2026-05-21 13:27:31 +08:00
parent 2231a4e2f5
commit 457c555df6
3 changed files with 13 additions and 16 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
/**
* Single archive — soft delete one record
*/
async function archiveOne(Model, where, deletedBy, transaction) {
const record = await Model.findOne({ where });
async function archiveOne(Model, options, deletedBy, transaction) {
const record = await Model.findOne(options);
if (!record) return null;
await record.update({ deletedBy: deletedBy ?? null }, { transaction });
await record.destroy({ transaction });