From 6623dba2f6cd4a4ca7b25f7086991afef092cd26 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 22 Aug 2024 15:48:00 +0700
Subject: <iman> update new register view

---
 src-migrate/modules/register/components/Form.tsx | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

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

diff --git a/src-migrate/modules/register/components/Form.tsx b/src-migrate/modules/register/components/Form.tsx
index 78566fae..ba28b32f 100644
--- a/src-migrate/modules/register/components/Form.tsx
+++ b/src-migrate/modules/register/components/Form.tsx
@@ -12,9 +12,10 @@ import Link from "next/link";
 interface FormProps {
   type: string;
   required: boolean;
+  isPKP: boolean;
 }
 
-const Form: React.FC<FormProps> = ({ type, required }) => {
+const Form: React.FC<FormProps> = ({ type, required, isPKP }) => {
   const {
     form,
     isCheckedTNC,
@@ -25,6 +26,7 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
   } = useRegisterStore()
 
   const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors])
+  console.log("errors",errors)
 
   const router = useRouter()
   const toast = useToast()
@@ -33,6 +35,17 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
     const { name, value } = event.target;
     updateForm(name, value)
     validate()
+    if(isPKP){
+      updateForm('nama_wajib_pajak','')
+      updateForm('sppkp_document','')
+      updateForm('npwp_document','')
+      updateForm('industry','')
+      updateForm('badanUsaha','')
+      updateForm('email_partner','')
+      updateForm('business_name','')
+      updateForm('companyType','')
+      updateForm('npwp','')
+    }
   }
 
   const mutation = useMutation({
@@ -77,6 +90,7 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
         break
     }
   }
+  console.log(!isFormValid,!isCheckedTNC,mutation.isLoading,!isValidCaptcha)
 
   return (
     <form className="mt-6 grid grid-cols-1 gap-y-4" onSubmit={handleSubmit}>
@@ -152,7 +166,7 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
 
       {type==='individu' && (
         <>
-          {/* <FormCaptcha /> */}
+          <FormCaptcha />
     
           <TermCondition />
           <button
-- 
cgit v1.2.3

