v1 review pass: fixed some minor bugs

This commit is contained in:
khannurien
2026-03-16 11:08:39 +00:00
parent e88fed4e98
commit 867e64cb5b
37 changed files with 1228 additions and 400 deletions

View File

@@ -18,7 +18,11 @@ export function castVote(dumpId: string, userId: string): number {
} catch (err) {
db.exec("ROLLBACK;");
if (err instanceof Error && err.message.includes("UNIQUE constraint")) {
throw new APIException(APIErrorCode.VALIDATION_ERROR, 409, "Already voted");
throw new APIException(
APIErrorCode.VALIDATION_ERROR,
409,
"Already voted",
);
}
throw err;
}