From f528457281040259eafccd76a1c9fd35aac54558 Mon Sep 17 00:00:00 2001 From: NishantGupt786 Date: Mon, 18 Mar 2024 12:30:10 +0530 Subject: [PATCH] feat --- .../src/app/submit-project/submit-project-form.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devsoc24-portal-fe/src/app/submit-project/submit-project-form.tsx b/devsoc24-portal-fe/src/app/submit-project/submit-project-form.tsx index 3f383a4..7796858 100644 --- a/devsoc24-portal-fe/src/app/submit-project/submit-project-form.tsx +++ b/devsoc24-portal-fe/src/app/submit-project/submit-project-form.tsx @@ -19,6 +19,7 @@ import toast from "react-hot-toast"; import axios, { AxiosError } from "axios"; import ToastContainer from "@/components/ToastContainer"; import { useRouter } from "next/navigation"; +import { IdeaStore } from "@/store/store"; interface FormValues { name: string; track: string; @@ -44,6 +45,7 @@ const tracks = [ ]; export default function SubmitProjectForm() { + const { getIdea, SetIdea } = IdeaStore(); const router = useRouter(); const form = useForm({ resolver: zodResolver(ideaSchema), @@ -71,6 +73,8 @@ export default function SubmitProjectForm() { void toast.promise(handleSubmit(), { loading: "Cooking...", success: () => { + SetIdea("idea found"); + void router.push("/home"); return `Project submitted successfully!`; }, error: (err: AxiosError) => {