speedup loading some pages (reduce data amount of trail lists) (#236)

* speedup loading some pages (reduce data amount of trail lists)

* optimize code

* fix save bio, if no tileset defined
This commit is contained in:
slothful-vassal
2025-04-08 17:50:25 +02:00
committed by GitHub
parent 3973fe7dd9
commit 809615d2f5
5 changed files with 47 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
import { ExpandType } from "$lib/models/list";
import { Trail } from "$lib/models/trail";
import { pb } from "$lib/pocketbase";
import { categories_index } from "$lib/stores/category_store";
@@ -10,8 +11,8 @@ export const load: Load = async ({ params, fetch }) => {
return error(400, "Bad Request")
}
const categories = await categories_index(fetch)
const lists = await lists_index({ q: "", author: pb.authStore.record?.id ?? "" }, 1, -1, fetch)
const lists = await lists_index({ q: "", author: pb.authStore.record?.id ?? "" }, 1, -1, fetch, ExpandType.None)
let trail: Trail;
if (params.id === "new") {
trail = new Trail("", { category: categories[0] });