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:
15
server/db.ts
15
server/db.ts
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user