Skip to content

Commit

Permalink
Resolved name change issues in ContactPage.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
rushabhhere committed Aug 6, 2022
1 parent 173c7dc commit f133384
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/src/pages/ContactPage/ContactPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MetaTags, useMutation } from '@redwoodjs/web'
import { toast, Toaster } from '@redwoodjs/web/toast'

const CREATE_CONTACT = gql`
mutation CreateContact($input: CreateContactInput!) {
mutation CreateContactMutation($input: CreateContactInput!) {
createContact(input: $input) {
id
}
Expand All @@ -31,7 +31,7 @@ interface FormValues {
const ContactPage = () => {
const formMethods = useForm({ mode: 'onBlur' })

const [createContact, { loading, error }] = useMutation<
const [create, { loading, error }] = useMutation<
CreateContact,
CreateContactVariables
>(CREATE_CONTACT, {
Expand All @@ -41,16 +41,16 @@ const ContactPage = () => {
},
})

const handleSubmit: SubmitHandler<FormValues> = (data) => {
createContact({ variables: { input: data } })
const onSubmit: SubmitHandler<FormValues> = (data) => {
create({ variables: { input: data } })
}

return (
<>
<MetaTags title="Contact" description="Contact page" />

<Toaster />
<Form onSubmit={handleSubmit} error={error} formMethods={formMethods}>
<Form onSubmit={onSubmit} error={error} formMethods={formMethods}>
<FormError
error={error}
wrapperClassName="py-4 px-6 rounded-lg bg-red-100 text-red-700"
Expand Down

0 comments on commit f133384

Please sign in to comment.