mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-20 18:15:35 -05:00
don't allow add votes api if voting is not active
This commit is contained in:
@@ -403,6 +403,8 @@ const addVotes = async ({
|
||||
input: z.infer<typeof votesSchema>;
|
||||
userId: number;
|
||||
}) => {
|
||||
if (!getVotingRange().isHappening)
|
||||
throw httpError.badRequest("voting is not happening right now");
|
||||
const [plusStatuses, suggestions] = await Promise.all([
|
||||
prisma.plusStatus.findMany({}),
|
||||
prisma.plusSuggestion.findMany({ where: { isResuggestion: false } }),
|
||||
|
||||
Reference in New Issue
Block a user