From 453f377e42866cc68a03b2fef0a672590dfd68dd Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 23 Aug 2024 13:29:30 +0700
Subject: <iman>  update new register

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

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

diff --git a/src-migrate/modules/register/components/FormBisnis.tsx b/src-migrate/modules/register/components/FormBisnis.tsx
index dec1bbf8..42d7aaa3 100644
--- a/src-migrate/modules/register/components/FormBisnis.tsx
+++ b/src-migrate/modules/register/components/FormBisnis.tsx
@@ -23,7 +23,7 @@ interface Industry {
   category: string;
 }
 
-interface CompanyType {
+interface company_type_id {
   value: string;
   label: string;
 }
@@ -43,7 +43,7 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
   const [selectedCompanyId, setSelectedCompanyId] = useState<string>('');
 
   const [industries, setIndustries] = useState<Industry[]>([]);
-  const [companyTypes, setCompanyTypes] = useState<CompanyType[]>([]);
+  const [companyTypes, setCompanyTypes] = useState<company_type_id[]>([]);
   const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors]);
 
   const router = useRouter();
@@ -58,13 +58,13 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
   }, []);
 
   useEffect(() => {
-    const selectedCompanyType = companyTypes.find(company => company.value === watch('companyType'));
+    const selectedCompanyType = companyTypes.find(company => company.value === watch('company_type_id'));
     if (selectedCompanyType) {
       updateFormBisnis("company_type_id", selectedCompanyType?.value);
       setSelectedCompanyId(selectedCompanyType?.label)
       validateFormBisnis();
     }
-  }, [watch('companyType'), companyTypes]);
+  }, [watch('company_type_id'), companyTypes]);
 
   useEffect(() => {
     const selectedIndustryType = industries.find(industry => industry.value === watch('industry'));
@@ -183,11 +183,11 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
         <div className="flex justify-between items-start gap-2 h-12">
           <div className='w-4/5 pr-1'>
             <Controller
-              name='companyType'
+              name='company_type_id'
               control={control}
               render={(props) => <HookFormSelect {...props} options={companyTypes} disabled={required} placeholder="Badan Usaha"/>}
               />
-              {!required &&  !!errors.companyType && <span className="form-msg-danger">{errors.companyType}</span>}
+              {!required &&  !!errors.company_type_id && <span className="form-msg-danger">{errors.company_type_id}</span>}
           </div>
           <div className="w-[120%]">
             <input
-- 
cgit v1.2.3

