Allow phrases to be purged

This commit is contained in:
Tarrgon
2025-05-29 10:28:23 -04:00
parent f7723e8aad
commit b5e631a965
2 changed files with 27 additions and 5 deletions
+4
View File
@@ -245,6 +245,10 @@ export class Database {
await Database.db.run('DELETE from ticket_phrases WHERE id = ?', id);
}
static async removeAllTicketPhrasesFor(id: string): Promise<number> {
return (await Database.db.run('DELETE from ticket_phrases WHERE user_id = ?', id)).changes!;
}
static async getTicketPhrasesFor(userId: string): Promise<TicketPhrase[]> {
return await Database.db.all<TicketPhrase[]>('SELECT * from ticket_phrases WHERE user_id = ?', userId);
}