Checkpoint: Ajout bouton "Purger les données" (admin uniquement) avec boîte de dialogue de confirmation sur VeilleDashboard et AAPDashboard. Procédures tRPC veille.purge et aap.purge ajoutées côté serveur.

This commit is contained in:
Manus
2026-04-28 04:33:20 -04:00
parent c3e1720e83
commit 8f2a22e4b1
6 changed files with 160 additions and 7 deletions

View File

@@ -433,3 +433,18 @@ export async function saveRssSettings(data: Partial<Omit<InsertRssSettings, "id"
});
}
}
// ─── Purge ───────────────────────────────────────────────────────────────────
export async function purgeVeilleItems(): Promise<number> {
const db = await getDb();
if (!db) throw new Error("Database not available");
const result = await db.delete(veilleItems);
return (result as any).affectedRows ?? 0;
}
export async function purgeAapItems(): Promise<number> {
const db = await getDb();
if (!db) throw new Error("Database not available");
const result = await db.delete(aapItems);
return (result as any).affectedRows ?? 0;
}