first styling and store for reactive etape modale

This commit is contained in:
Valentin
2024-07-23 00:01:44 +02:00
parent 5deb49de6d
commit 59016eb91a
18 changed files with 750 additions and 428 deletions

View File

@@ -0,0 +1,25 @@
import { defineStore } from 'pinia';
import REST from '../api/rest-axios';
export const useEtapeStore = defineStore('etape', {
state: () => ({
etapeData: null,
loading: false,
error: null,
}),
actions: {
async fetchEtapeData(nid) {
this.loading = true;
this.error = null;
try {
const response = await REST.get(`/node/${nid}?_format=json`);
this.etapeData = response.data;
} catch (error) {
this.error = 'Failed to fetch data';
console.error('Issue with getNodeData', error);
} finally {
this.loading = false;
}
},
},
});