mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -3,8 +3,8 @@
|
||||
/**
|
||||
* Single archive — soft delete one record
|
||||
*/
|
||||
async function archiveOne(Model, options, deletedBy, transaction) {
|
||||
const record = await Model.findOne(options);
|
||||
async function archiveOne(Model, where, deletedBy, transaction) {
|
||||
const record = await Model.findOne({ where, transaction });
|
||||
if (!record) return null;
|
||||
await record.update({ deletedBy: deletedBy ?? null }, { transaction });
|
||||
await record.destroy({ transaction });
|
||||
|
||||
Reference in New Issue
Block a user