DISABLE SSR AND TRANSITION TO SPA
This commit is contained in:
18
src/routes/data/raceresults/+page.ts
Normal file
18
src/routes/data/raceresults/+page.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import type { RaceResult } from "$lib/schema";
|
||||
import type { PageLoad } from "../../$types";
|
||||
|
||||
export const load: PageLoad = async ({ fetch }) => {
|
||||
// TODO: Duplicated code from racepicks/+page.server.ts
|
||||
const fetch_raceresults = async (): Promise<RaceResult[]> => {
|
||||
const raceresults: RaceResult[] = await pb
|
||||
.collection("raceresultsdesc")
|
||||
.getFullList({ fetch: fetch });
|
||||
|
||||
return raceresults;
|
||||
};
|
||||
|
||||
return {
|
||||
results: await fetch_raceresults(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user