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]!