summaryrefslogtreecommitdiff
path: root/client/src/components/RsvpForm.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/components/RsvpForm.tsx')
-rw-r--r--client/src/components/RsvpForm.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/client/src/components/RsvpForm.tsx b/client/src/components/RsvpForm.tsx
index c7c30f4..b3ed3b3 100644
--- a/client/src/components/RsvpForm.tsx
+++ b/client/src/components/RsvpForm.tsx
@@ -37,10 +37,10 @@ const Status = ({ isError, setOpen }: StatusProps) => {
};
function RsvpForm() {
- const [updateGuest, { isLoading, isSuccess, isError, error }] =
+ const [updateGuest, { isLoading, isSuccess, isError }] =
useUpdateGuestMutation();
const guest: Guest = useOutletContext();
- const previousPartySize = useRef(guest?.partySize - 1);
+ const previousPartySize = useRef(guest.partySize ?? 1 - 1);
const [open, setOpen] = useState<boolean>(false);
useEffect(() => {
@@ -55,14 +55,14 @@ function RsvpForm() {
formState: { errors },
} = useForm<Guest>({
defaultValues: {
- id: guest?.id,
- firstName: guest?.firstName,
- lastName: guest?.lastName,
- attendance: guest?.attendance,
- email: guest?.email,
- message: guest?.message,
- partySize: guest?.partySize,
- partyList: guest?.partyList,
+ id: guest.id,
+ firstName: guest.firstName,
+ lastName: guest.lastName,
+ attendance: guest.attendance,
+ email: guest.email,
+ message: guest.message,
+ partySize: guest.partySize,
+ partyList: guest.partyList,
},
});