Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

## [4.10.4] - 2025-12-18

Expand Down
13 changes: 9 additions & 4 deletions packages/web/src/app/[domain]/repos/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { ReposTable } from "./components/reposTable";
import { RepoIndexingJobStatus, Prisma } from "@sourcebot/db";
import z from "zod";

const numberSchema = z.coerce.number().int().positive();

interface ReposPageProps {
searchParams: Promise<{
page?: string;
Expand All @@ -17,12 +19,15 @@ interface ReposPageProps {
}>;
}

export default async function ReposPage({ searchParams }: ReposPageProps) {
const params = await searchParams;
export default async function ReposPage(props: ReposPageProps) {
const params = await props.searchParams;

console.log('asdf:');
console.log(z.coerce.number().int().safeParse(params.page).error);

// Parse pagination parameters with defaults
const page = z.number().int().positive().safeParse(params.page).data ?? 1;
const pageSize = z.number().int().positive().safeParse(params.pageSize).data ?? 5;
const page = numberSchema.safeParse(params.page).data ?? 1;
const pageSize = numberSchema.safeParse(params.pageSize).data ?? 5;

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