adds feed

This commit is contained in:
Christian Beutel
2025-07-11 16:02:18 +02:00
parent 25bf00a38b
commit 237d12bfec
33 changed files with 967 additions and 119 deletions

View File

@@ -1,5 +1,6 @@
import type { Trail } from "$lib/models/trail";
import { categories_index } from "$lib/stores/category_store";
import { feed_index } from "$lib/stores/feed_store";
import { trails_recommend } from "$lib/stores/trail_store";
import type { ServerLoad } from "@sveltejs/kit";
@@ -7,11 +8,13 @@ export const load: ServerLoad = async ({ params, locals, fetch }) => {
try {
await categories_index(fetch)
const feed = await feed_index(1, 10, fetch);
const trails: Trail[] = await trails_recommend(4, fetch)
return { trails: trails ?? [] }
return { trails: trails ?? [], feed }
} catch (e) {
console.error(e)
}
return { trails: [] }
return { trails: [], feed: {items: [], page: 1, perPage: 1, totalItems: 0, totalPages: 0} }
};