add reset feature for admins/orgs
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 28s
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 28s
This commit is contained in:
@@ -222,6 +222,16 @@ const Hunts = {
|
||||
.run(name, description, expiryDate || null, id);
|
||||
},
|
||||
|
||||
resetScans(id) {
|
||||
const doReset = db.transaction(() => {
|
||||
// Delete all scans for packages in this hunt
|
||||
db.prepare('DELETE FROM scans WHERE package_id IN (SELECT id FROM packages WHERE hunt_id = ?)').run(id);
|
||||
// Reset package scan counters and scanner references
|
||||
db.prepare('UPDATE packages SET scan_count = 0, first_scanned_by = NULL, last_scanned_by = NULL, hint_text = NULL, hint_image = NULL WHERE hunt_id = ?').run(id);
|
||||
});
|
||||
doReset();
|
||||
},
|
||||
|
||||
delete(id) {
|
||||
const doDelete = db.transaction(() => {
|
||||
// Delete scans for all packages in this hunt
|
||||
|
||||
Reference in New Issue
Block a user