diff --git a/src/app/post-meetup/page.tsx b/src/app/post-meetup/page.tsx index 32f47444..97e03024 100644 --- a/src/app/post-meetup/page.tsx +++ b/src/app/post-meetup/page.tsx @@ -1,7 +1,6 @@ 'use client'; import { useForm } from '@tanstack/react-form'; -import { z } from 'zod'; import { MeetupCapField, @@ -19,14 +18,6 @@ import { CreateGroupPayload } from '@/types/service/group'; const PostMeetupPage = () => { const { mutate } = useCreateGroup(); - const CreateGroupSchema = { - title: z.string().min(2), - location: z.string().min(2), - startTime: z.string().min(2), - description: z.string().min(2), - maxParticipants: z.number().min(2), - }; - const form = useForm({ defaultValues: { title: '', @@ -39,9 +30,6 @@ const PostMeetupPage = () => { maxParticipants: 0, images: [], } as CreateGroupPayload, - validators: { - onChange: () => CreateGroupSchema, - }, onSubmit: ({ value }) => { console.log(value); const res = mutate(value); @@ -51,12 +39,7 @@ const PostMeetupPage = () => { return (
-
{ - e.preventDefault(); - form.handleSubmit(); - }} - > +
} name='title' /> } name='location' /> @@ -73,10 +56,7 @@ const PostMeetupPage = () => { } name='tags' />
- } - selector={(state) => state} - /> + form.handleSubmit()} />
); diff --git a/src/components/pages/post-meetup/post-button/index.tsx b/src/components/pages/post-meetup/post-button/index.tsx index 5b6a6071..0b438fde 100644 --- a/src/components/pages/post-meetup/post-button/index.tsx +++ b/src/components/pages/post-meetup/post-button/index.tsx @@ -1,15 +1,13 @@ -import { AnyFormState } from '@tanstack/react-form'; - import { Button } from '@/components/ui'; interface Props { - state: AnyFormState; + onSubmitClick: () => void; } -export const MeetupSubmitButton = ({ state }: Props) => { +export const MeetupSubmitButton = ({ onSubmitClick }: Props) => { return (
-