fix(projects): fetch projects directly instead of using useAsyncData

This commit is contained in:
2026-01-14 15:08:31 +01:00
parent 0163699484
commit 6b03337d45

View File

@@ -31,8 +31,7 @@ export const useProjectsStore = defineStore("projects", {
async loadProjects() {
this.loading = true;
const { data: projects } = await useAsyncData("projects", () =>
queryCollection("projects")
const projects = await queryCollection("projects")
.order("order", "ASC")
.select(
"id",
@@ -45,10 +44,10 @@ export const useProjectsStore = defineStore("projects", {
"technologies",
"tasks",
)
.all(),
);
if (!projects.value) throw "Cannot load projects";
this.projects = projects.value.map((project) => ({
.all();
if (!projects) throw "Cannot load projects";
this.projects = projects.map((project) => ({
...project,
id: project.id
.split("/")[2]!