diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-04 15:00:57 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-04 15:00:57 +0700 |
| commit | ffebc1b10550e10de6cde9b4757dd0d5a4cf644c (patch) | |
| tree | e598c88b6c98404b843594aa06c1f7a3621d6ab1 /src/lib | |
| parent | 8bf81ed018dfd89b30f887c09689442881bb4872 (diff) | |
fix invoice pagination
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/invoice/components/Invoices.jsx | 6 | ||||
| -rw-r--r-- | src/lib/transaction/components/Transactions.jsx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/invoice/components/Invoices.jsx b/src/lib/invoice/components/Invoices.jsx index 8918fae4..96686bbb 100644 --- a/src/lib/invoice/components/Invoices.jsx +++ b/src/lib/invoice/components/Invoices.jsx @@ -24,7 +24,7 @@ const Invoices = () => { const router = useRouter() const { q = '', page = 1 } = router.query - const limit = 10 + const limit = 15 const query = { name: q, @@ -36,7 +36,7 @@ const Invoices = () => { const [inputQuery, setInputQuery] = useState(q) const [toOthers, setToOthers] = useState(null) - const pageCount = Math.ceil(invoices?.data?.saleOrderTotal / limit) + const pageCount = Math.ceil(invoices?.data?.invoiceTotal / limit) let pageQuery = _.omit(query, ['limit', 'offset']) pageQuery = _.pickBy(pageQuery, _.identity) pageQuery = toQuery(pageQuery) @@ -235,7 +235,7 @@ const Invoices = () => { <Pagination pageCount={pageCount} currentPage={parseInt(page)} - url={`/my/transactions${pageQuery}`} + url={`/my/invoices${pageQuery}`} className='mt-2 mb-2' /> </div> 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, |
