From 18d8eaa22b86b48a0278e975413868e720e46dbb Mon Sep 17 00:00:00 2001 From: Sneed Date: Wed, 9 Apr 2025 16:23:01 +0100 Subject: [PATCH] allow for viewing single-option polls --- src/schemas/poll.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schemas/poll.ts b/src/schemas/poll.ts index 1c6229247..a455a7bd9 100644 --- a/src/schemas/poll.ts +++ b/src/schemas/poll.ts @@ -14,7 +14,7 @@ const pollSchema = z.object({ expires_at: z.string().datetime().nullable().catch(null), id: z.string(), multiple: z.boolean().catch(false), - options: z.array(pollOptionSchema).min(2), + options: z.array(pollOptionSchema).min(1), voters_count: z.number().catch(0), votes_count: z.number().catch(0), own_votes: z.array(z.number()).nonempty().nullable().catch(null), @@ -34,4 +34,4 @@ const pollSchema = z.object({ type Poll = z.infer; type PollOption = Poll['options'][number]; -export { pollSchema, type Poll, type PollOption }; \ No newline at end of file +export { pollSchema, type Poll, type PollOption };