13 lines
328 B
JavaScript
13 lines
328 B
JavaScript
|
|
import { defineStore } from "pinia";
|
||
|
|
import { useApiStore } from "./api.js";
|
||
|
|
import { ref } from "vue";
|
||
|
|
|
||
|
|
export const useProjectsStore = defineStore("projects", () => {
|
||
|
|
const projects = ref([]);
|
||
|
|
|
||
|
|
const api = useApiStore();
|
||
|
|
api.fetchPageData("projects").then((json) => (projects.value = json));
|
||
|
|
|
||
|
|
return { projects };
|
||
|
|
});
|