From 6b03337d45b3f795326f75dea3e9f694409bd92c Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Wed, 14 Jan 2026 15:08:31 +0100 Subject: [PATCH] fix(projects): fetch projects directly instead of using useAsyncData --- app/stores/projects.ts | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/app/stores/projects.ts b/app/stores/projects.ts index 784af40..2b5c216 100644 --- a/app/stores/projects.ts +++ b/app/stores/projects.ts @@ -31,24 +31,23 @@ export const useProjectsStore = defineStore("projects", { async loadProjects() { this.loading = true; - const { data: projects } = await useAsyncData("projects", () => - queryCollection("projects") - .order("order", "ASC") - .select( - "id", - "order", - "scope", - "title", - "link", - "description", - "summary", - "technologies", - "tasks", - ) - .all(), - ); - if (!projects.value) throw "Cannot load projects"; - this.projects = projects.value.map((project) => ({ + const projects = await queryCollection("projects") + .order("order", "ASC") + .select( + "id", + "order", + "scope", + "title", + "link", + "description", + "summary", + "technologies", + "tasks", + ) + .all(); + + if (!projects) throw "Cannot load projects"; + this.projects = projects.map((project) => ({ ...project, id: project.id .split("/")[2]!