Skip to content
Open
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
4 changes: 3 additions & 1 deletion packages/admin/src/lib/api/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ export async function fetchContentList(
): Promise<FindManyResult<ContentItem>> {
const params = new URLSearchParams();
if (options?.cursor) params.set("cursor", options.cursor);
if (options?.limit) params.set("limit", String(options.limit));
// Always include limit to ensure pagination works correctly
// Use provided value, or default to 100 for better UX in admin lists
params.set("limit", String(options?.limit ?? 100));
if (options?.status) params.set("status", options.status);
if (options?.locale) params.set("locale", options.locale);

Expand Down
5 changes: 3 additions & 2 deletions packages/admin/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ function ContentListPage() {
fetchContentList(collection, {
locale: activeLocale,
cursor: pageParam as string | undefined,
limit: 100,
}),
initialPageParam: undefined as string | undefined,
getNextPageParam: (lastPage) => lastPage.nextCursor,
// Explicitly return undefined when no cursor to ensure React Query correctly calculates hasNextPage
getNextPageParam: (lastPage) =>
lastPage.nextCursor && lastPage.nextCursor.length > 0 ? lastPage.nextCursor : undefined,
enabled: !!manifest,
});

Expand Down
Loading