Skip to content

Commit 84e53c8

Browse files
fix(web): Fix repo pagination (#689)
1 parent 3dc5019 commit 84e53c8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111
- Bake Sourcebot version into code rather than relying on build arg. [#680](https://github.com/sourcebot-dev/sourcebot/pull/680)
12+
- Fix issue with `/repos` page pagination. [#689](https://github.com/sourcebot-dev/sourcebot/pull/689)
1213

1314
## [4.10.4] - 2025-12-18
1415

packages/web/src/app/[domain]/repos/page.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { ReposTable } from "./components/reposTable";
66
import { RepoIndexingJobStatus, Prisma } from "@sourcebot/db";
77
import z from "zod";
88

9+
const numberSchema = z.coerce.number().int().positive();
10+
911
interface ReposPageProps {
1012
searchParams: Promise<{
1113
page?: string;
@@ -17,12 +19,15 @@ interface ReposPageProps {
1719
}>;
1820
}
1921

20-
export default async function ReposPage({ searchParams }: ReposPageProps) {
21-
const params = await searchParams;
22+
export default async function ReposPage(props: ReposPageProps) {
23+
const params = await props.searchParams;
24+
25+
console.log('asdf:');
26+
console.log(z.coerce.number().int().safeParse(params.page).error);
2227

2328
// Parse pagination parameters with defaults
24-
const page = z.number().int().positive().safeParse(params.page).data ?? 1;
25-
const pageSize = z.number().int().positive().safeParse(params.pageSize).data ?? 5;
29+
const page = numberSchema.safeParse(params.page).data ?? 1;
30+
const pageSize = numberSchema.safeParse(params.pageSize).data ?? 5;
2631

2732
// Parse filter parameters
2833
const search = z.string().optional().safeParse(params.search).data ?? '';

0 commit comments

Comments
 (0)