summaryrefslogtreecommitdiff
path: root/src-migrate/modules/register/components/Form.tsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-22 15:48:00 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-22 15:48:00 +0700
commit6623dba2f6cd4a4ca7b25f7086991afef092cd26 (patch)
tree6370cf4eddd5d4b5834c3a5186a86839166c475b /src-migrate/modules/register/components/Form.tsx
parent2ffc49bb65a16f07cf5a3b7e4926c34ea07b9460 (diff)
<iman> update new register view
Diffstat (limited to 'src-migrate/modules/register/components/Form.tsx')
-rw-r--r--src-migrate/modules/register/components/Form.tsx18
1 files changed, 16 insertions, 2 deletions
diff --git a/src-migrate/modules/register/components/Form.tsx b/src-migrate/modules/register/components/Form.tsx
index 78566fae..ba28b32f 100644
--- a/src-migrate/modules/register/components/Form.tsx
+++ b/src-migrate/modules/register/components/Form.tsx
@@ -12,9 +12,10 @@ import Link from "next/link";
interface FormProps {
type: string;
required: boolean;
+ isPKP: boolean;
}
-const Form: React.FC<FormProps> = ({ type, required }) => {
+const Form: React.FC<FormProps> = ({ type, required, isPKP }) => {
const {
form,
isCheckedTNC,
@@ -25,6 +26,7 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
} = useRegisterStore()
const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors])
+ console.log("errors",errors)
const router = useRouter()
const toast = useToast()
@@ -33,6 +35,17 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
const { name, value } = event.target;
updateForm(name, value)
validate()
+ if(isPKP){
+ updateForm('nama_wajib_pajak','')
+ updateForm('sppkp_document','')
+ updateForm('npwp_document','')
+ updateForm('industry','')
+ updateForm('badanUsaha','')
+ updateForm('email_partner','')
+ updateForm('business_name','')
+ updateForm('companyType','')
+ updateForm('npwp','')
+ }
}
const mutation = useMutation({
@@ -77,6 +90,7 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
break
}
}
+ console.log(!isFormValid,!isCheckedTNC,mutation.isLoading,!isValidCaptcha)
return (
<form className="mt-6 grid grid-cols-1 gap-y-4" onSubmit={handleSubmit}>
@@ -152,7 +166,7 @@ const Form: React.FC<FormProps> = ({ type, required }) => {
{type==='individu' && (
<>
- {/* <FormCaptcha /> */}
+ <FormCaptcha />
<TermCondition />
<button