diff --git a/app/create-team/page.jsx b/app/create-team/page.jsx index 4d93442..1bb210b 100644 --- a/app/create-team/page.jsx +++ b/app/create-team/page.jsx @@ -5,13 +5,13 @@ import { useForm } from "react-hook-form" import { Button } from "../../@/components/ui/button" import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, } from "../../@/components/ui/form" import { Input } from "../../@/components/ui/input" import { useState } from 'react'; @@ -22,8 +22,8 @@ import { useToast } from '../../@/components/ui/use-toast'; - - export default function CreateTeamForm() { + +export default function CreateTeamForm() { // const [image, setImage] = useState(''); const [teamname, setTeamname] = useState(''); @@ -49,13 +49,13 @@ import { useToast } from '../../@/components/ui/use-toast'; players: '', requests: '' }, - }); + }); - const { reset } = form; + const { reset } = form; const onSubmit = async (data) => { try { - if(teamname !== '' && game !== '' && role !== '' && rank !== '' && server !== '' && language !== '' && players !== '' && requests !== '') { + if (teamname !== '' && game !== '' && role !== '' && rank !== '' && server !== '' && language !== '' && players !== '' && requests !== '') { const response = await axios.post('/api/teams/create-team', data); toast({ @@ -73,242 +73,226 @@ import { useToast } from '../../@/components/ui/use-toast'; setPlayers(''); setRequests(''); } - // const response = await axios.post('/api/teams/create-team', data); - - // toast({ - // title: 'Success', - // description: response.data.message, - // }); - - // reset(); - // setTeamname(''); - // setGame(''); - // setRole(''); - // setRank(''); - // setServer(''); - // setLanguage(''); - // setPlayers(''); - // setRequests(''); } catch (error) { - console.error('Error during create-team:', error); + console.error('Error during create-team:', error); - toast({ - title: 'Sign Up Failed', - description: errorMessage, - variant: 'destructive', - }); + toast({ + title: 'Sign Up Failed', + description: errorMessage, + variant: 'destructive', + }); } - }; + }; return (
Create your team and start competing
-TEAM FINDER
-TEAM FINDER
+