From 15a9e599c1c1dc688f601da12be421ae55f61916 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 23 Aug 2024 08:32:22 +0700
Subject: <iman> update error handling

---
 src-migrate/modules/register/components/FormBisnis.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 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 932083df..dec1bbf8 100644
--- a/src-migrate/modules/register/components/FormBisnis.tsx
+++ b/src-migrate/modules/register/components/FormBisnis.tsx
@@ -187,7 +187,7 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
               control={control}
               render={(props) => <HookFormSelect {...props} options={companyTypes} disabled={required} placeholder="Badan Usaha"/>}
               />
-              {!required && selectedCompanyId === '' && <span className="form-msg-danger">{errors.companyType}</span>}
+              {!required &&  !!errors.companyType && <span className="form-msg-danger">{errors.companyType}</span>}
           </div>
           <div className="w-[120%]">
             <input
@@ -219,7 +219,7 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
           {selectedCategory && 
             <span className='text-gray_r-11 text-xs'>Kategori : {selectedCategory}</span>
           }
-          {!required && selectedCategory === '' && <span className="form-msg-danger">{errors.industry}</span>}
+          {!required && !!errors.industry && <span className="form-msg-danger">{errors.industry}</span>}
       </div>
 
       <div>
-- 
cgit v1.2.3

