diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-26 11:39:23 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-26 11:39:23 +0700 |
| commit | 0a548e87febeab3d25ba7d5270b73b757f130b26 (patch) | |
| tree | 5f726f2564f6a38a871b2559d3762fb1ff2ad239 /src/lib/transaction/components/Transactions.jsx | |
| parent | 42fed2490fe537b46a717eafaf1b1e4a5e0a08c8 (diff) | |
fix bug on update qty cart and create quotation page
Diffstat (limited to 'src/lib/transaction/components/Transactions.jsx')
| -rw-r--r-- | src/lib/transaction/components/Transactions.jsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index 13417707..54316c3d 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -19,7 +19,7 @@ import MobileView from '@/core/components/views/MobileView' import DesktopView from '@/core/components/views/DesktopView' import Menu from '@/lib/auth/components/Menu' -const Transactions = () => { +const Transactions = ({ context = '' }) => { const router = useRouter() const { q = '', page = 1 } = router.query @@ -28,6 +28,7 @@ const Transactions = () => { const query = { name: q, offset: (page - 1) * limit, + context, limit } const { transactions } = useTransactions({ query }) @@ -54,7 +55,7 @@ const Transactions = () => { const handleSubmit = (e) => { e.preventDefault() - router.push(`/my/transactions?q=${inputQuery}`) + router.push(`${router.pathname}?q=${inputQuery}`) } return ( @@ -89,7 +90,7 @@ const Transactions = () => { {transactions.data?.saleOrders?.map((saleOrder, index) => ( <div className='p-4 shadow border border-gray_r-3 rounded-md' key={index}> <div className='grid grid-cols-2'> - <Link href={`/my/transaction/${saleOrder.id}`}> + <Link href={`${router.pathname}/${saleOrder.id}`}> <span className='text-caption-2 text-gray_r-11'>No. Transaksi</span> <h2 className='text-danger-500 mt-1'>{saleOrder.name}</h2> </Link> @@ -101,7 +102,7 @@ const Transactions = () => { /> </div> </div> - <Link href={`/my/transaction/${saleOrder.id}`}> + <Link href={`${router.pathname}/${saleOrder.id}`}> <div className='grid grid-cols-2 mt-3'> <div> <span className='text-caption-2 text-gray_r-11'>No. Purchase Order</span> @@ -135,7 +136,7 @@ const Transactions = () => { <Pagination pageCount={pageCount} currentPage={parseInt(page)} - url={`/my/transactions${pageQuery}`} + url={router.pathname + pageQuery} className='mt-2 mb-2' /> @@ -249,7 +250,7 @@ const Transactions = () => { {transactions.data?.saleOrders?.map((saleOrder) => ( <tr key={saleOrder.id}> <td> - <Link href={`/my/transaction/${saleOrder.id}`}>{saleOrder.name}</Link> + <Link href={`${router.pathname}/${saleOrder.id}`}>{saleOrder.name}</Link> </td> <td>-</td> <td className='!text-left'>{saleOrder.sales}</td> @@ -267,7 +268,7 @@ const Transactions = () => { <Pagination pageCount={pageCount} currentPage={parseInt(page)} - url={`/my/transactions${pageQuery}`} + url={router.pathname + pageQuery} className='mt-2 mb-2' /> </div> |
