diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-01-21 16:34:44 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-01-21 16:34:44 +0700 |
| commit | 898c82a908d604862596e477bd66ecc15fe3af0c (patch) | |
| tree | 18c5c3765748759d4538e766d62110353d24b9fc /src/lib/merchant/components/Konfirmasi.jsx | |
| parent | cb083185ce59df7143ea258e147a118a1e416e56 (diff) | |
<iman> update merchant
Diffstat (limited to 'src/lib/merchant/components/Konfirmasi.jsx')
| -rw-r--r-- | src/lib/merchant/components/Konfirmasi.jsx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/merchant/components/Konfirmasi.jsx b/src/lib/merchant/components/Konfirmasi.jsx index 45db7388..6deabe05 100644 --- a/src/lib/merchant/components/Konfirmasi.jsx +++ b/src/lib/merchant/components/Konfirmasi.jsx @@ -17,6 +17,7 @@ import InformasiPerusahaan from './InformasiPerusahaan'; import InformasiVendor from './InformasiVendor'; import SyaratDagang from './SyaratDagang'; import Dokumen from './Dokumen'; +import createMerchantApi from '../api/createMerchantApi'; import useDevice from '@/core/hooks/useDevice'; import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'; import { useRouter } from 'next/router'; @@ -34,11 +35,24 @@ const Konfirmasi = ({ chekValid, buttonSubmitClick }) => { formRef.current(); // Memicu submit form di InformasiPerusahaan } }; - const handleIsError = (value) => { + const handleIsError = async (value) => { console.log('LAHKAH SELANJUTNYA', value); if (!value) { // goToNextStep(); - toast.success('Berhasil medaftarkan merchant'); + const toastId = toast.loading('Mengirimkan formulir merchant...'); + const data = { + merchant_request: true, + }; + const create_leads = await createMerchantApi({ data }); + if (create_leads) { + toast.dismiss(toastId); + toast.success('Berhasil medaftarkan merchant'); + reset(); + // router.push('/+'); + } else { + toast.dismiss(toastId); + toast.error('Gagal menambahkan data'); + } } reset(); router.push('/'); |
