diff options
author | Michael Hunteman <michael@huntm.net> | 2024-07-07 11:54:22 -0700 |
---|---|---|
committer | Michael Hunteman <michael@huntm.net> | 2024-07-07 11:54:52 -0700 |
commit | 03ca04fdb738cc151d775b76e1bc38aec792521a (patch) | |
tree | 2b7e7487b2026fc388f8b31e0fb36bd804dfeb89 /client | |
parent | 34696eaf5fbd0c3152ee92917c23128950ca0fe9 (diff) |
Redirect to guest login after submitting
Diffstat (limited to 'client')
-rw-r--r-- | client/src/components/RsvpForm.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/components/RsvpForm.tsx b/client/src/components/RsvpForm.tsx index 71ae7d0..f20d810 100644 --- a/client/src/components/RsvpForm.tsx +++ b/client/src/components/RsvpForm.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useRef } from 'react'; -import { useOutletContext } from 'react-router-dom'; +import { useNavigate, useOutletContext } from 'react-router-dom'; import { Button, Container, @@ -20,6 +20,7 @@ function RsvpForm() { const [updateGuest] = useUpdateGuestMutation(); const guest: Guest = useOutletContext(); const previousPartySize = useRef(guest?.partySize - 1); + const navigate = useNavigate(); const { register, @@ -42,6 +43,7 @@ function RsvpForm() { const onSubmit = async (data: Guest) => { updateGuest({ ...data }); + navigate('/guest/login'); }; const { fields, append, remove } = useFieldArray({ |