diff --git a/app/(app)/alpha/additional-details/_actions.ts b/app/(app)/alpha/additional-details/_actions.ts index cf2a81f5..78d300d3 100644 --- a/app/(app)/alpha/additional-details/_actions.ts +++ b/app/(app)/alpha/additional-details/_actions.ts @@ -16,7 +16,7 @@ import { db } from "@/server/db"; import { user } from "@/server/db/schema"; import { eq } from "drizzle-orm"; -export async function handleFormSlideOneSubmit(dataInput: TypeSlideOneSchema) { +export async function slideOneSubmitAction(dataInput: TypeSlideOneSchema) { const session = await getServerAuthSession(); if (!session || !session.user) { redirect("/get-started"); @@ -47,7 +47,7 @@ export async function handleFormSlideOneSubmit(dataInput: TypeSlideOneSchema) { } } -export async function handleFormSlideTwoSubmit(dataInput: TypeSlideTwoSchema) { +export async function slideTwoSubmitAction(dataInput: TypeSlideTwoSchema) { const session = await getServerAuthSession(); if (!session || !session.user) { redirect("/get-started"); @@ -75,9 +75,7 @@ export async function handleFormSlideTwoSubmit(dataInput: TypeSlideTwoSchema) { } } -export async function handleFormSlideThreeSubmit( - dataInput: TypeSlideThreeSchema, -) { +export async function slideThreeSubmitAction(dataInput: TypeSlideThreeSchema) { const session = await getServerAuthSession(); if (!session || !session.user) { redirect("/get-started"); diff --git a/app/(app)/alpha/additional-details/_client.tsx b/app/(app)/alpha/additional-details/_client.tsx index 635742f3..c8c1d4e6 100644 --- a/app/(app)/alpha/additional-details/_client.tsx +++ b/app/(app)/alpha/additional-details/_client.tsx @@ -23,10 +23,22 @@ import { monthsOptions, } from "@/app/(app)/alpha/additional-details/selectOptions"; import { - handleFormSlideOneSubmit, - handleFormSlideThreeSubmit, - handleFormSlideTwoSubmit, + slideOneSubmitAction, + slideThreeSubmitAction, + slideTwoSubmitAction, } from "./_actions"; +import { Heading, Subheading } from "./components/heading"; +import { Divider } from "./components/divider"; +import { + ErrorMessage, + Field, + Fieldset, + Label, + Legend, +} from "./components/fieldset"; +import { Input } from "./components/input"; +import { Select } from "./components/select"; +import { Button } from "./components/button"; type UserDetails = { username: string; @@ -103,7 +115,7 @@ function SlideOne({ details }: { details: UserDetails }) { const onFormSubmit = async (data: TypeSlideOneSchema) => { try { - const isSuccess = await handleFormSlideOneSubmit(data); + const isSuccess = await slideOneSubmitAction(data); if (isSuccess) { toast.success("Saved"); router.push(`?slide=${2}`, { scroll: false }); @@ -116,107 +128,101 @@ function SlideOne({ details }: { details: UserDetails }) { }; return ( -