feat: update validation message for expires_date to allow today's date

This commit is contained in:
Marco Pedone 2026-04-20 12:12:58 +02:00
parent 2676dc61ed
commit c1c0ad2a2f

View file

@ -41,8 +41,8 @@ type FormProps = {
const Schema = z
.object({
expires_date: z.date().refine((d) => isAfter(d, new Date()), {
message: "La data deve essere nel futuro",
expires_date: z.date().refine((d) => isAfter(d, new Date()) || d.toDateString() === new Date().toDateString(), {
message: "La data deve essere nel futuro o oggi",
}),
expires_time: z.string(),
mailType: z.enum(TemplateKeys),