v1 review pass: fixed some minor bugs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user