fix: handle empty filter param and add created/updated fields for PB 0.25 compat

This commit is contained in:
2026-07-19 15:03:15 +00:00
parent a45a2a0bb2
commit 327c5bf733
48 changed files with 49 additions and 1684 deletions
+2 -2
View File
@@ -9,12 +9,12 @@ export const GET = withAuth(async (request: NextRequest, _user) => {
const { searchParams } = new URL(request.url);
const page = parseInt(searchParams.get('page') || '1');
const perPage = parseInt(searchParams.get('perPage') || '50');
const filter = searchParams.get('filter') || '';
const filter = searchParams.get('filter') || undefined;
const sort = searchParams.get('sort') || '-created';
const pb = createPocketBaseClient();
const result = await pb.collection('agents').getList(page, perPage, {
filter,
...(filter ? { filter } : {}),
sort,
});