fix(ui/books): guard against null items from PocketBase listAll
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user