Skip to content

Commit

Permalink
fix(community-prompts): correct pagination error
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbenben committed Apr 22, 2024
1 parent f0ce7ac commit 78a6ec6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/pages/community-prompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ function CommunityPrompts() {
if (result && result[0].length > 0) {
setUserPrompts(result[0]);
setTotal(result[1].data.meta.pagination.total);
const fetchedTotal = result[1].data.meta.pagination.total;
setTotal(Math.min(fetchedTotal, 1000));
} else {
console.log("No data returned from the server");
}
Expand Down Expand Up @@ -312,7 +310,7 @@ function CommunityPrompts() {
))}
</ul>
<div style={{ display: "flex", justifyContent: "center" }}>
<Pagination current={currentPage} total={total} showQuickJumper showSizeChanger={false} onChange={onChangePage} />
<Pagination current={currentPage} pageSize={pageSize} total={total} showQuickJumper showSizeChanger={false} onChange={onChangePage} />
</div>
<div
style={{
Expand Down

0 comments on commit 78a6ec6

Please sign in to comment.