From c61477111b95d83a9b862f242923b911364f3612 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 19 Oct 2024 11:49:38 +0700
Subject: <iman> fix section pengiriman

---
 src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

(limited to 'src/lib/pengajuan-tempo/component/PengajuanTempo.jsx')

diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
index 257648ca..612b009a 100644
--- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
+++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
@@ -8,6 +8,7 @@ import { Controller, useForm } from 'react-hook-form';
 import {
   usePengajuanTempoStore,
   usePengajuanTempoStoreKontakPerson,
+  usePengajuanTempoStorePengiriman,
 } from '../../../../src-migrate/modules/register/stores/usePengajuanTempoStore';
 import { ChevronRightIcon, ChevronLeftIcon } from '@heroicons/react/24/outline';
 const PengajuanTempo = () => {
@@ -21,6 +22,12 @@ const PengajuanTempo = () => {
     validateKontakPerson,
     updateFormKontakPerson,
   } = usePengajuanTempoStoreKontakPerson();
+  const {
+    formPengiriman,
+    errorsPengiriman,
+    validatePengiriman,
+    updateFormPengiriman,
+  } = usePengajuanTempoStorePengiriman();
   const [notValid, setNotValid] = useState(false);
   const [buttonSubmitClick, setButtonSubmitClick] = useState(false);
   const stepDivs = [
@@ -40,8 +47,7 @@ const PengajuanTempo = () => {
   const stepDivsError = [
     errors,
     errorsKontakPerson,
-    <div>Kontak Person</div>,
-    <div>Pengiriman</div>,
+    errorsPengiriman,
     <div>Referensi</div>,
     <div>Dokumen</div>,
     <div>Konfirmasi</div>,
@@ -49,8 +55,7 @@ const PengajuanTempo = () => {
   const stepDivsForm = [
     form,
     formKontakPerson,
-    <div>Kontak Person</div>,
-    <div>Pengiriman</div>,
+    formPengiriman,
     <div>Referensi</div>,
     <div>Dokumen</div>,
     <div>Konfirmasi</div>,
@@ -58,8 +63,7 @@ const PengajuanTempo = () => {
   const stepDivsUpdateForm = [
     updateForm,
     updateFormKontakPerson,
-    <div>Kontak Person</div>,
-    <div>Pengiriman</div>,
+    updateFormPengiriman,
     <div>Referensi</div>,
     <div>Dokumen</div>,
     <div>Konfirmasi</div>,
@@ -78,8 +82,9 @@ const PengajuanTempo = () => {
     [stepDivsError[currentStep]]
   );
   useEffect(() => {
-    validateKontakPerson();
     validate();
+    validateKontakPerson();
+    validatePengiriman();
 
     window.scrollTo({
       top: 0,
@@ -103,7 +108,6 @@ const PengajuanTempo = () => {
       return;
     } else {
       saveToLocalStorage(stepLabels[currentStep], stepDivsForm[currentStep]);
-      const cachedData = getFromLocalStorage(stepLabels[currentStep]);
       setButtonSubmitClick(!buttonSubmitClick);
       setNotValid(false);
     }
-- 
cgit v1.2.3

