Add Nix flake for Zod-PocketBase dev environment and remove doc and
playground
This commit is contained in:
10
src/utils.ts
Normal file
10
src/utils.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { sortBy } from "es-toolkit";
|
||||
import type { CollectionModel } from "pocketbase";
|
||||
import { getPocketbase } from "./sdk.js";
|
||||
import type { Credentials } from "./config.ts";
|
||||
|
||||
export async function fetchCollections(credentials: Credentials): Promise<CollectionModel[]> {
|
||||
const pocketbase = await getPocketbase(credentials);
|
||||
const collections = await pocketbase.collections.getFullList();
|
||||
return sortBy(collections, ["name"]);
|
||||
}
|
||||
Reference in New Issue
Block a user