From 453f377e42866cc68a03b2fef0a672590dfd68dd Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 23 Aug 2024 13:29:30 +0700 Subject: update new register --- src-migrate/modules/register/components/FormBisnis.tsx | 12 ++++++------ src-migrate/modules/register/stores/useRegisterStore.ts | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src-migrate/modules') 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 = ({ type, required, isPKP }) => { const [selectedCompanyId, setSelectedCompanyId] = useState(''); const [industries, setIndustries] = useState([]); - const [companyTypes, setCompanyTypes] = useState([]); + const [companyTypes, setCompanyTypes] = useState([]); const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors]); const router = useRouter(); @@ -58,13 +58,13 @@ const FormBisnis: React.FC = ({ 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 = ({ type, required, isPKP }) => {
} /> - {!required && !!errors.companyType && {errors.companyType}} + {!required && !!errors.company_type_id && {errors.company_type_id}}
((set, get) => ({ form: { business_name: '', - companyType: '', + company_type_id: 0, name: '', email: '', email_partner: '', @@ -37,7 +37,7 @@ export const useRegisterStore = create((set, get) => ({ sppkp_document: '', npwp_document: '', nameWajibPajak: '', - industry: '', + industry: { value: '', label: '' }, badanUsaha: '', jenisUsaha: '', npwp: '', @@ -45,7 +45,7 @@ export const useRegisterStore = create((set, get) => ({ is_pkp: '', }, formBisnis: { - companyType: '', + company_type_id: 0, business_name: '', name: '', nama_wajib_pajak : '', @@ -56,7 +56,7 @@ export const useRegisterStore = create((set, get) => ({ sppkp_document: '', npwp_document: '', nameWajibPajak: '', - industry: '', + industry: { value: '', label: '' }, badanUsaha: '', jenisUsaha: '', npwp: '', -- cgit v1.2.3