diff --git a/app/(app)/alpha/additional-details/_client.tsx b/app/(app)/alpha/additional-details/_client.tsx index 8eb6abb3..74c25f78 100644 --- a/app/(app)/alpha/additional-details/_client.tsx +++ b/app/(app)/alpha/additional-details/_client.tsx @@ -72,29 +72,19 @@ function SlideOne({ details }: { details: UserDetails }) { const onFormSubmit = async (data: TypeSlideOneSchema) => { try { - // TODO add server action logic - // await handleFormSlideOneSubmit(data); - toast.success("Saved"); - router.push(`?slide=${2}`, { scroll: false }); + // const isSuccess = await handleFormSlideOneSubmit(data); TODO add server action + const isSuccess = true; + if (isSuccess) { + toast.success("Saved"); + router.push(`?slide=${2}`, { scroll: false }); + } else { + toast.error("Error, saving was unsuccessful."); + } } catch (error) { toast.error("An unexpected error occurred."); } }; - // const onFormSubmit = async (data: TypeSlideOneSchema) => { - // try { - // const isSuccess = await handleFormSlideOneSubmit(data); - // if (isSuccess) { - // toast.success("Saved"); - // router.push(`?slide=${2}`, { scroll: false }); - // } else { - // toast.error("Error, saving was unsuccessful."); - // } - // } catch (error) { - // toast.error("An unexpected error occurred."); - // } - // }; - return (