From 8f36292c816773e5bcd0bf70f795f869aee69215 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 23 May 2025 10:41:53 +0700 Subject: Revert "form-merchant & quotation tampilan" This reverts commit 60cbad2ae4b551d8f1e6959a3c90134c16b10e26. --- .../merchant/components/InformasiPerusahaan.jsx | 46 +++++++++------------- 1 file changed, 18 insertions(+), 28 deletions(-) (limited to 'src/lib/merchant/components') diff --git a/src/lib/merchant/components/InformasiPerusahaan.jsx b/src/lib/merchant/components/InformasiPerusahaan.jsx index 8e4f9c56..1e8704ac 100644 --- a/src/lib/merchant/components/InformasiPerusahaan.jsx +++ b/src/lib/merchant/components/InformasiPerusahaan.jsx @@ -56,7 +56,6 @@ const CreateMerchant = forwardRef( resolver: yupResolver(validationSchema), defaultValues, }); - const [bisnisType, setBisnisType] = useState([]); const [state, setState] = useState([]); const [cities, setCities] = useState([]); const [districts, setDistricts] = useState([]); @@ -72,7 +71,6 @@ const CreateMerchant = forwardRef( const kartuNamaRef = useRef(null); const suratPernyataanRef = useRef(null); const fotoKantorRef = useRef(null); - const bisnisTypeRef = useRef(null); const handleConfirmSubmit = (format, base64) => { if (format == 'pdf') { @@ -230,7 +228,7 @@ const CreateMerchant = forwardRef( accountNumber: data.accountNumber || '', phone: data.phone || '', mobile: data.mobile || '', - bisnisType: data.bisnisType || '', + bisnisType: data.bisnisType ? parseInt(data.bisnisType) : null, categoryPerusahaan: data.categoryPerusahaan ? parseInt(data.categoryPerusahaan) : null, @@ -264,12 +262,6 @@ const CreateMerchant = forwardRef( loadData(); }, [reset, handleIsError]); - useEffect(() => { - if (errors.bisnisType && bisnisTypeRef.current) { - bisnisTypeRef.current.scrollIntoView({ behavior: "smooth", block: "center" }); - } - }, [errors.bisnisType]); - useEffect(() => { const loadProfile = async () => { try { @@ -538,6 +530,7 @@ const CreateMerchant = forwardRef( } return; } + const create_leads = await createMerchantApi({ data }); if (create_leads) { toast.dismiss(toastId); @@ -600,11 +593,9 @@ const CreateMerchant = forwardRef( name="bisnisType" control={control} render={({ field }) => ( -
-
+
-
-
+
{dataBisnisType.map((option) => (
+ )} />
@@ -649,7 +640,7 @@ const CreateMerchant = forwardRef( className='form-input' /> - Format: PT. INDOTEKNIK DOTCOM GEMILANG{''} + Format: PT. INDOTEKNIK DOTCOM GEMILANG
{errors.name?.message} @@ -731,7 +722,7 @@ const CreateMerchant = forwardRef( {!isKonfirmasi && ( - Alamat sesuai dengan alamat perusahaan{''} + Alamat sesuai dengan alamat perusahaan )}
@@ -1560,7 +1551,7 @@ const CreateMerchant = forwardRef( name="bisnisType" control={control} render={({ field }) => ( -
+
{dataBisnisType.map((option) => ( @@ -1579,15 +1570,15 @@ const CreateMerchant = forwardRef(
{option.label} - ))}
+
+ {errors.bisnisType?.message} +
)} /> -
- {errors.bisnisType?.message} -
+