fix(ui/books): guard against null items from PocketBase listAll

This commit is contained in:
Admin
2026-03-04 00:46:40 +05:00
parent f6febfdb5e
commit 89ff90629f
2 changed files with 3 additions and 3 deletions

View File

@@ -125,7 +125,7 @@ async function listAll<T>(collection: string, filter = '', sort = ''): Promise<T
const data = await pbGet<PBList<T>>(
`/api/collections/${collection}/records?${params.toString()}`
);
return data.items;
return data.items ?? [];
}
async function listOne<T>(collection: string, filter: string): Promise<T | null> {