fix: pagination total pages

This commit is contained in:
Damillora 2021-05-10 09:47:19 +07:00
parent 9624a408b2
commit 5123bc8a24
2 changed files with 2 additions and 0 deletions

View File

@ -13,6 +13,7 @@
const data = await getPosts({page});
if(Array.isArray(data.posts)) {
posts = data.posts;
totalPages = data.totalPage;
}
}
onMount(() => {

View File

@ -22,6 +22,7 @@
queryParams = queryString.parse(location.search);
if(queryParams.page) {
page = queryParams.page;
totalPages = data.totalPage;
}
getData();
})