Fix poll vote submission failure and add pridecorner.ca nginx routing

Users could not submit scheduling poll votes when an invalid or partial
email was entered — Zod rejected empty strings and non-email text with a
generic validation error. Added client-side email validation in both
SchedulingPollPage and SchedulingPollWidget, plus z.preprocess() on the
backend to coerce empty strings to undefined. Also added pridecorner.ca
to all nginx server blocks and added generate_nginx_configs() to
config.sh so template-based configs are generated during setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 14:15:26 -07:00
parent 62f906d6f0
commit f57a6d07f5
6 changed files with 53 additions and 12 deletions

View File

@@ -37,7 +37,10 @@ export const addOptionsSchema = z.object({
export const submitVotesSchema = z.object({
voterName: z.string().min(1, 'Name is required').max(100),
voterEmail: z.string().email().max(200).optional(),
voterEmail: z.preprocess(
(val) => (typeof val === 'string' && val.trim() === '' ? undefined : val),
z.string().email('Please enter a valid email address').max(200).optional(),
),
voterToken: z.string().optional(),
votes: z.array(z.object({
optionId: z.string().min(1),