chore: move totalPages to meta

This commit is contained in:
Arvid Norlin
2024-08-16 14:34:25 +02:00
parent 8c75b9bcd7
commit 1bcd3b81e1
4 changed files with 10 additions and 15 deletions

View File

@@ -93,13 +93,11 @@ export default function TransactionTable() {
limit,
page,
})
// Should the active page be mirroried in the URL with params?
// That way the actual fetch could be moved up and Mobile/Desktop can be strictly server side
useEffect(() => {
if (typeof data?.data.pages === "number") {
setTotalPages(data?.data.pages)
if (typeof data?.meta.totalPages === "number") {
setTotalPages(data?.meta.totalPages)
}
}, [data?.data.pages])
}, [data?.meta.totalPages])
useEffect(() => {
if (data?.data.transactions) {