From 0a548e87febeab3d25ba7d5270b73b757f130b26 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 26 Apr 2023 11:39:23 +0700
Subject: fix bug on update qty cart and create quotation page

---
 src/lib/transaction/components/Transactions.jsx | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

(limited to 'src/lib/transaction/components/Transactions.jsx')

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>
-- 
cgit v1.2.3


From 7b12c20a46e4119e9a34ad15f9109765876a265b Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Thu, 4 May 2023 09:43:57 +0700
Subject: fixing sitemap

---
 src/lib/transaction/components/Transactions.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/transaction/components/Transactions.jsx')

diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx
index 54316c3d..736f5ece 100644
--- a/src/lib/transaction/components/Transactions.jsx
+++ b/src/lib/transaction/components/Transactions.jsx
@@ -49,7 +49,7 @@ const Transactions = ({ context = '' }) => {
   }
 
   const pageCount = Math.ceil(transactions?.data?.saleOrderTotal / limit)
-  let pageQuery = _.omit(query, ['limit', 'offset'])
+  let pageQuery = _.omit(query, ['limit', 'offset', 'context'])
   pageQuery = _.pickBy(pageQuery, _.identity)
   pageQuery = toQuery(pageQuery)
 
-- 
cgit v1.2.3


From ffebc1b10550e10de6cde9b4757dd0d5a4cf644c Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Thu, 4 May 2023 15:00:57 +0700
Subject: fix invoice pagination

---
 src/lib/transaction/components/Transactions.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/transaction/components/Transactions.jsx')

diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx
index 736f5ece..bfb8c66b 100644
--- a/src/lib/transaction/components/Transactions.jsx
+++ b/src/lib/transaction/components/Transactions.jsx
@@ -23,7 +23,7 @@ const Transactions = ({ context = '' }) => {
   const router = useRouter()
   const { q = '', page = 1 } = router.query
 
-  const limit = 10
+  const limit = 15
 
   const query = {
     name: q,
-- 
cgit v1.2.3

