From 0b5f187f45e0bbf111e11a94415f20d5e34f7c5c Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 27 Aug 2024 14:51:14 +0700
Subject: <iman> update new field register

---
 src-migrate/modules/register/components/RegistrasiBisnis.tsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

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

diff --git a/src-migrate/modules/register/components/RegistrasiBisnis.tsx b/src-migrate/modules/register/components/RegistrasiBisnis.tsx
index 443ff0a0..1d8317f1 100644
--- a/src-migrate/modules/register/components/RegistrasiBisnis.tsx
+++ b/src-migrate/modules/register/components/RegistrasiBisnis.tsx
@@ -48,6 +48,16 @@ const RegistrasiBisnis = () => {
       validate();
     }
   }, [selectedValue,]);
+  
+  useEffect(() => {
+    if (isTerdaftar) {
+      updateForm("is_terdaftar", 'true');
+      validate();
+    } else {
+      updateForm("is_terdaftar", 'false');
+      validate();
+    }
+  }, [isTerdaftar,]);
 
   const   handleChange = (value: string) => {
     setSelectedValue(value);
@@ -65,11 +75,9 @@ const RegistrasiBisnis = () => {
     setSelectedValueBisnis(value);
     if (value === "true") {
       validate();
-      updateForm('is_terdaftar','true')
       setIsTerdaftar(true);
     } else {
       validate();
-      updateForm('is_terdaftar','false')
       setIsTerdaftar(false);
     }
   };
-- 
cgit v1.2.3

