18 lines
480 B
TypeScript
18 lines
480 B
TypeScript
import { client, watch } from "$lib/pocketbase";
|
|
import type { RecipesResponse } from "$lib/pocketbase/pocketbase-types";
|
|
import type { PageLoad } from "./$types";
|
|
|
|
export const load: PageLoad = async ({ parent, fetch }) => {
|
|
// const filter = client.filter("user != ''", {});
|
|
const expand = "user";
|
|
const queryParams = {
|
|
// filter,
|
|
expand,
|
|
fetch,
|
|
};
|
|
const recipes = await watch<RecipesResponse<any>>("recipes", queryParams);
|
|
|
|
return {
|
|
recipes,
|
|
};
|
|
}; |