Skip to content

Commit fe4ea3c

Browse files
Update worker/src/routers/api/apiRouter.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 4753909 commit fe4ea3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

worker/src/routers/api/apiRouter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ function getAPIRouterV1(
676676

677677
try {
678678
// Parse pagination parameters
679-
const pageNum = page ? parseInt(page as string) : 0;
680-
const pageSizeNum = pageSize ? parseInt(pageSize as string) : 50;
679+
const pageNum = Math.max(0, page ? parseInt(page as string) : 0);
680+
const pageSizeNum = Math.min(Math.max(1, pageSize ? parseInt(pageSize as string) : 50), 1000);
681681

682682
// Get table data from the wallet durable object
683683
const tableData = await walletStub.getTableData(tableName, pageNum, pageSizeNum);

0 commit comments

Comments
 (0)