From f0cde08a3fda95b1738a765358022241aea404bf Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 26 Aug 2024 10:28:15 +0700
Subject: <iman> update logic new register validation

---
 src-migrate/modules/register/index.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src-migrate/modules/register/index.tsx')

diff --git a/src-migrate/modules/register/index.tsx b/src-migrate/modules/register/index.tsx
index da41a5bb..5df2476e 100644
--- a/src-migrate/modules/register/index.tsx
+++ b/src-migrate/modules/register/index.tsx
@@ -8,6 +8,7 @@ import Image from "next/image";
 import IndoteknikLogo from "~/images/logo.png";
 import AccountActivation from "../account-activation";
 import { useState } from "react";
+import { useRegisterStore } from "./stores/useRegisterStore";
 
 const LOGO_WIDTH = 150;
 const LOGO_HEIGHT = LOGO_WIDTH / 3;
@@ -15,13 +16,20 @@ const LOGO_HEIGHT = LOGO_WIDTH / 3;
 const Register = () => {
   const [isIndividuClicked, setIsIndividuClicked] = useState(true);
   const [isBisnisClicked, setIsBisnisClicked] = useState(false);
+  const {resetForm,
+    updateForm
+  } = useRegisterStore()
 
   const handleIndividuClick = () => {
+    resetForm();
     setIsIndividuClicked(true);
     setIsBisnisClicked(false);
   };
-
+  
   const handleBisnisClick = () => {
+    resetForm();
+    updateForm("is_terdaftar", 'false')
+    updateForm("type_acc", 'business')
     setIsIndividuClicked(false);
     setIsBisnisClicked(true);
   };
-- 
cgit v1.2.3

