diff --git a/components/webhook/CreateWebhook.tsx b/components/webhook/CreateWebhook.tsx index b0470ecc0..db8f232f3 100644 --- a/components/webhook/CreateWebhook.tsx +++ b/components/webhook/CreateWebhook.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'next-i18next'; import React from 'react'; import toast from 'react-hot-toast'; import type { ApiResponse } from 'types'; -import type { WebookFormSchema } from 'types'; +import type { WebhookFormSchema } from 'types'; import ModalForm from './Form'; import { defaultHeaders } from '@/lib/common'; @@ -23,8 +23,8 @@ const CreateWebhook = ({ const { t } = useTranslation('common'); const onSubmit = async ( - values: WebookFormSchema, - formikHelpers: FormikHelpers + values: WebhookFormSchema, + formikHelpers: FormikHelpers ) => { const response = await fetch(`/api/teams/${team.slug}/webhooks`, { method: 'POST', diff --git a/components/webhook/EditWebhook.tsx b/components/webhook/EditWebhook.tsx index 5c549c8a2..a9e5dc459 100644 --- a/components/webhook/EditWebhook.tsx +++ b/components/webhook/EditWebhook.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'next-i18next'; import React from 'react'; import toast from 'react-hot-toast'; import type { EndpointOut } from 'svix'; -import type { WebookFormSchema } from 'types'; +import type { WebhookFormSchema } from 'types'; import type { ApiResponse } from 'types'; import ModalForm from './Form'; @@ -37,8 +37,8 @@ const EditWebhook = ({ } const onSubmit = async ( - values: WebookFormSchema, - formikHelpers: FormikHelpers + values: WebhookFormSchema, + formikHelpers: FormikHelpers ) => { const response = await fetch( `/api/teams/${team.slug}/webhooks/${endpoint.id}`, diff --git a/components/webhook/EventTypes.tsx b/components/webhook/EventTypes.tsx index cb0850765..8a5a180f8 100644 --- a/components/webhook/EventTypes.tsx +++ b/components/webhook/EventTypes.tsx @@ -1,6 +1,6 @@ import { eventTypes } from '@/lib/common'; import React, { ReactElement } from 'react'; -import type { WebookFormSchema } from 'types'; +import type { WebhookFormSchema } from 'types'; import { Checkbox } from '../shared'; const EventTypes = ({ @@ -9,7 +9,7 @@ const EventTypes = ({ error, }: { onChange: React.ChangeEventHandler; - values: WebookFormSchema['eventTypes']; + values: WebhookFormSchema['eventTypes']; error: string | string[] | undefined; }) => { const events: ReactElement[] = []; diff --git a/components/webhook/Form.tsx b/components/webhook/Form.tsx index 19f6732a8..92f7a0e74 100644 --- a/components/webhook/Form.tsx +++ b/components/webhook/Form.tsx @@ -4,7 +4,7 @@ import { useFormik } from 'formik'; import { useTranslation } from 'next-i18next'; import React from 'react'; import { Button } from 'react-daisyui'; -import type { WebookFormSchema } from 'types'; +import type { WebhookFormSchema } from 'types'; import * as Yup from 'yup'; import Modal from '../shared/Modal'; import { EventTypes } from '@/components/webhook'; @@ -13,8 +13,8 @@ import { maxLengthPolicies } from '@/lib/common'; interface FormProps { visible: boolean; setVisible: (visible: boolean) => void; - initialValues: WebookFormSchema; - onSubmit: FormikConfig['onSubmit']; + initialValues: WebhookFormSchema; + onSubmit: FormikConfig['onSubmit']; title: string; editMode?: boolean; } @@ -27,7 +27,7 @@ const Form = ({ title, editMode = false, }: FormProps) => { - const formik = useFormik({ + const formik = useFormik({ validationSchema: Yup.object().shape({ name: Yup.string().required().max(maxLengthPolicies.webhookDescription), url: Yup.string().required().url().max(maxLengthPolicies.webhookEndpoint), diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03dc..a4a7b3f5c 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/types/base.ts b/types/base.ts index a90a1e990..85ffb4654 100644 --- a/types/base.ts +++ b/types/base.ts @@ -24,7 +24,7 @@ export type TeamWithMemberCount = Prisma.TeamGetPayload<{ }; }>; -export type WebookFormSchema = { +export type WebhookFormSchema = { name: string; url: string; eventTypes: string[];