diff options
Diffstat (limited to 'src-migrate/modules/register/components/RegistrasiBisnis.tsx')
| -rw-r--r-- | src-migrate/modules/register/components/RegistrasiBisnis.tsx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src-migrate/modules/register/components/RegistrasiBisnis.tsx b/src-migrate/modules/register/components/RegistrasiBisnis.tsx index 6ace27f9..b8ea5fff 100644 --- a/src-migrate/modules/register/components/RegistrasiBisnis.tsx +++ b/src-migrate/modules/register/components/RegistrasiBisnis.tsx @@ -29,13 +29,11 @@ const RegistrasiBisnis = () => { const [selectedValueBisnis, setSelectedValueBisnis] = useState('false'); const { form, - formBisnis, isCheckedTNC, isValidCaptcha, errors, - updateFormBisnis, - validateFormBisnis, validate, + updateForm } = useRegisterStore() const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors]) const toast = useToast() @@ -45,18 +43,18 @@ const RegistrasiBisnis = () => { useEffect(() => { if (selectedValue === "PKP") { - updateFormBisnis("is_pkp", 'true'); - validateFormBisnis(); + updateForm("is_pkp", 'true'); + validate(); } else { - updateFormBisnis("is_pkp", 'false'); - validateFormBisnis(); + updateForm("is_pkp", 'false'); + validate(); } }, [selectedValue,]); const handleChange = (value: string) => { setSelectedValue(value); if (value === "PKP") { - validateFormBisnis(); + validate(); setIsIndividuRequired(true); setIsPKP(true); } else { @@ -68,9 +66,12 @@ const RegistrasiBisnis = () => { const handleChangeBisnis = (value: string) => { setSelectedValueBisnis(value); + console.log('value',value) if (value === "true") { + updateForm('is_terdaftar','true') setIsTerdaftar(true); } else { + updateForm('is_terdaftar','false') setIsTerdaftar(false); } }; @@ -85,8 +86,8 @@ const RegistrasiBisnis = () => { const handleSubmit = async () => { console.log("form",form) - console.log("form Bisnis",formBisnis) - const response = await mutation.mutateAsync(formBisnis) + console.log("form Bisnis",form) + const response = await mutation.mutateAsync(form) console.log("response",response) |
