From dd076f305694820afc1ec1beeeba2744a7aad1a7 Mon Sep 17 00:00:00 2001 From: Benjamin Johnson Date: Mon, 18 Mar 2024 17:43:15 -0700 Subject: [PATCH] Fix input validation with email and binary choice fields --- frontend/src/app/vsr/page.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/vsr/page.tsx b/frontend/src/app/vsr/page.tsx index 1fdbad1..c27902e 100644 --- a/frontend/src/app/vsr/page.tsx +++ b/frontend/src/app/vsr/page.tsx @@ -726,10 +726,6 @@ const VeteranServiceRequest: React.FC = () => { placeholder="e.g. justintimberlake@gmail.com" {...register("email", { required: "Email Address is required", - pattern: { - value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, - message: "Invalid Email Address", - }, })} required error={!!errors.email} @@ -835,7 +831,8 @@ const VeteranServiceRequest: React.FC = () => { name="serviceConnected" control={control} rules={{ - validate: (value) => value !== null || "Service connected is required", + validate: (value) => + [true, false].includes(value) || "Service connected is required", }} render={({ field }) => ( { name="petCompanion" control={control} rules={{ - validate: (value) => value !== null || "Service connected is required", + validate: (value) => + [true, false].includes(value) || "Companionship animal is required", }} render={({ field }) => (