Skip to content

Commit

Permalink
fix: coerce
Browse files Browse the repository at this point in the history
  • Loading branch information
userMeh committed Jul 24, 2024
1 parent 65a1a45 commit 1433ae3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/admin/app/ui/dashboard/votes/AddRound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function AddRound({ poll, setPoll }: Props) {
start_at: z.string(),
end_at: z.string(),
end_condition: z.enum(['simple', 'absolute', 'two-third', 'unanimous']),
keep: z.number().min(2, { message: 'Le nombre de choix à conserver doit être supérieur à 1' }),
keep: z.coerce.number().min(2, { message: 'Le nombre de choix à conserver doit être supérieur à 1' }),
max_choices: z.coerce.number().min(1, { message: 'Le nombre de choix doit être supérieur à 0' }),
})
.refine((data) => new Date(data.start_at) < new Date(data.end_at), {
Expand Down

0 comments on commit 1433ae3

Please sign in to comment.