summaryrefslogtreecommitdiff
path: root/src-migrate/modules/register/components
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules/register/components')
-rw-r--r--src-migrate/modules/register/components/FormBisnis.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src-migrate/modules/register/components/FormBisnis.tsx b/src-migrate/modules/register/components/FormBisnis.tsx
index 42d7aaa3..b58f2fec 100644
--- a/src-migrate/modules/register/components/FormBisnis.tsx
+++ b/src-migrate/modules/register/components/FormBisnis.tsx
@@ -17,7 +17,7 @@ interface FormProps {
isPKP: boolean;
}
-interface Industry {
+interface industry_id {
label: string;
value: string;
category: string;
@@ -42,7 +42,7 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
const [selectedCategory, setSelectedCategory] = useState<string>('');
const [selectedCompanyId, setSelectedCompanyId] = useState<string>('');
- const [industries, setIndustries] = useState<Industry[]>([]);
+ const [industries, setIndustries] = useState<industry_id[]>([]);
const [companyTypes, setCompanyTypes] = useState<company_type_id[]>([]);
const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors]);
@@ -67,13 +67,13 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
}, [watch('company_type_id'), companyTypes]);
useEffect(() => {
- const selectedIndustryType = industries.find(industry => industry.value === watch('industry'));
+ const selectedIndustryType = industries.find(industry => industry.value === watch('industry_id'));
if (selectedIndustryType) {
updateFormBisnis("industry_id", selectedIndustryType?.value);
setSelectedCategory(selectedIndustryType.label);
validateFormBisnis();
}
- }, [watch('industry'), industries]);
+ }, [watch('industry_id'), industries]);
useEffect(() => {
const loadIndustries = async () => {
@@ -212,14 +212,14 @@ const FormBisnis: React.FC<FormProps> = ({ type, required, isPKP }) => {
Klasifikasi Jenis Usaha
</label>
<Controller
- name='industry'
+ name='industry_id'
control={control}
render={(props) => <HookFormSelect {...props} options={industries} disabled={required} placeholder={'Select industry'}/>}
/>
{selectedCategory &&
<span className='text-gray_r-11 text-xs'>Kategori : {selectedCategory}</span>
}
- {!required && !!errors.industry && <span className="form-msg-danger">{errors.industry}</span>}
+ {!required && !!errors.industry_id && <span className="form-msg-danger">{errors.industry_id}</span>}
</div>
<div>