diff options
Diffstat (limited to 'client/src/components/RsvpForm.tsx')
-rw-r--r-- | client/src/components/RsvpForm.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/components/RsvpForm.tsx b/client/src/components/RsvpForm.tsx index fd7bcd5..b3ff0db 100644 --- a/client/src/components/RsvpForm.tsx +++ b/client/src/components/RsvpForm.tsx @@ -17,8 +17,7 @@ import MailIcon from '@mui/icons-material/Mail'; import { useForm, Controller, useFieldArray } from 'react-hook-form'; import { useUpdateGuestMutation } from '../slices/api/guestSlice'; import { isFetchBaseQueryError } from '../error'; -import Status from './Status'; -import { open } from '../slices/snackbarSlice'; +import { showSnackbar } from '../slices/snackbarSlice'; import type { Data } from '../error'; import type { Guest } from '../models'; @@ -51,7 +50,7 @@ function RsvpForm() { try { await updateGuest({ ...data }).unwrap(); dispatch( - open({ + showSnackbar({ message: 'RSVP updated', severity: 'success', }) @@ -59,14 +58,14 @@ function RsvpForm() { } catch (error) { if (isFetchBaseQueryError(error)) { dispatch( - open({ + showSnackbar({ message: (error.data as Data).message, severity: 'error', }) ); } else { dispatch( - open({ + showSnackbar({ message: 'RSVP failed', severity: 'error', }) @@ -276,7 +275,6 @@ function RsvpForm() { </Button> </div> </Grid> - <Status /> </Grid> </Paper> </form> |