feat(qr-custom): hapus satu & reset histori dengan password admin
All checks were successful
CI / test (push) Successful in 1m47s

- endpoint delete/reset, verifikasi admin_password
- tombol hapus di detail + reset di header histori
- versi 0.6.5
This commit is contained in:
oxpoe
2026-11-06 05:08:30 +07:00
parent 8fcb50e16a
commit a2888810ad
7 changed files with 56 additions and 4 deletions

View File

@@ -118,6 +118,16 @@ function acceptWarning(id, actor, note) {
return getById(id);
}
function remove(id) {
const r = db.prepare('DELETE FROM custom_qr_payments WHERE id=?').run(Number(id) || 0);
return r.changes || 0;
}
function clearAll() {
const r = db.prepare('DELETE FROM custom_qr_payments').run();
return r.changes || 0;
}
function regenerate(id, actor) {
const old = getById(id);
if (!old) throw new Error('Data tidak ditemukan.');
@@ -196,6 +206,8 @@ module.exports = {
markManualPaid,
acceptWarning,
regenerate,
remove,
clearAll,
reject,
markPaidFromWebhook,
markWarningFromWebhook,