diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-03-12 16:59:18 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-03-12 16:59:18 +0700 |
| commit | b4a595eaa8600e7bd1bafcef38abe4c01a5b664c (patch) | |
| tree | 79ae9f597e056df82b89d6bfd2dce8e2c4155485 /src/lib/transaction/components/Transactions.jsx | |
| parent | 6a682891b755a6f8d91edafe54a62047afcb5492 (diff) | |
<iman> fix transaction
Diffstat (limited to 'src/lib/transaction/components/Transactions.jsx')
| -rw-r--r-- | src/lib/transaction/components/Transactions.jsx | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index d93c9aef..ece97734 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -80,7 +80,6 @@ const Transactions = ({ context = '' }) => { const [isOpenCalender, setIsOpenCalender] = useState(false); const parseDate = (date) => { - console.log('masuk sini', date); if (null || 'null') return null; if (!date) return null; if (date instanceof Date) return date; // Jika sudah Date, langsung return @@ -95,19 +94,6 @@ const Transactions = ({ context = '' }) => { key: 'selection', }, ]); - console.log('startDate', startDate); - console.log('state', state); - // useEffect(() => { - // if (state[0].startDate != null) { - // setState([ - // { - // startDate: parseDate(startDate), - // endDate: parseDate(endDate), - // key: 'selection', - // }, - // ]); - // } - // }, [startDate, endDate]); const query = { name: q, @@ -369,7 +355,7 @@ const Transactions = ({ context = '' }) => { } if (status === 'all') { - router.push('/my/transactions'); + router.push(`${router.pathname}`); } else { setPageNew(1); } @@ -384,7 +370,7 @@ const Transactions = ({ context = '' }) => { }, ]); setIsOpenCalender(false); - router.push('/my/transactions'); + router.push(`${router.pathname}`); }; const formatDate = (dateString) => { @@ -649,7 +635,7 @@ const Transactions = ({ context = '' }) => { /> ))} <Link - href={`/my/quotations/${saleOrder?.id}`} + href={`${router.pathname}/${saleOrder?.id}`} className=' text-red-500 text-nowrap' > {saleOrder.products?.length > 6 @@ -730,7 +716,7 @@ const Transactions = ({ context = '' }) => { pageCount={pageCount} currentPage={parseInt(pageNew)} // url={router.pathname + pageQuery} - url={`/my/transactions?${toQuery(_.omit(query, ['page']))}`} + url={`${router.pathname}?${toQuery(_.omit(query, ['page']))}`} className='mt-2 mb-2' /> @@ -997,7 +983,7 @@ const Transactions = ({ context = '' }) => { className='border py-2 px-4 hover:border-red-500 w-full rounded-lg' > <Link - href={`/my/transactions/${saleOrder?.id}`} + href={`${router.pathname}/${saleOrder?.id}`} className='hover:border-red-500 block w-full' > <div className='flex flex-row justify-between items-center py-2'> @@ -1068,7 +1054,7 @@ const Transactions = ({ context = '' }) => { /> ))} <Link - href={`/my/quotations/${saleOrder?.id}`} + href={`${router.pathname}/${saleOrder?.id}`} className='text-sm text-red-500 text-nowrap' > {saleOrder.products?.length > 6 @@ -1182,7 +1168,7 @@ const Transactions = ({ context = '' }) => { pageCount={pageCount} currentPage={parseInt(pageNew)} // url={router.pathname + (pageQuery ? `?${pageQuery}` : '')} - url={`/my/transactions?${toQuery(_.omit(query, ['page']))}`} + url={`${router.pathname}?${toQuery(_.omit(query, ['page']))}`} className='mt-2 mb-2' /> </div> |
