Fix: stats and marks queries

This commit is contained in:
Grail Finder
2025-07-11 21:19:16 +03:00
parent f01fc12510
commit acf1386c73
7 changed files with 16 additions and 13 deletions

View File

@ -39,6 +39,6 @@ func (r *RepoProvider) CardMarksByRoomID(ctx context.Context, roomID string) ([]
}
func (r *RepoProvider) CardMarksRemoveByRoomID(ctx context.Context, roomID string) error {
db := getDB(ctx, r.DB)
_, err := db.ExecContext(ctx, "DELETE FROM card_marks WHERE room_id = ?;", roomID)
_, err := db.ExecContext(ctx, "DELETE FROM card_marks WHERE card_id IN (select id from word_cards where room_id = ?);", roomID)
return err
}