create dashboard

This commit is contained in:
mariapia.lorusso
2025-06-09 16:55:06 +02:00
parent 8b8843ee14
commit 3796213b7b
6 changed files with 1403 additions and 55 deletions

View File

@@ -13,20 +13,25 @@ export const UserPrefStore = defineStore('userpref_store', () => {
const selectedFileRE = ref(null)
const selectedScenario = ref(null)
async function fetchUserData(){
const auth = useAuth();
loadingStore.user_loading = true;
await auth.fetch().then((fetchedUser) => {
user.value = fetchedUser.data.data;
selectedApp.value = user.value.selectedApplication;
userLoaded.value = true;
loadingStore.user_loading = false;
}).catch((error) => {
reject(error);
});
};
async function fetchUserData() {
const auth = useAuth();
loadingStore.user_loading = true;
try {
const fetchedUser = await auth.fetch();
user.value = fetchedUser.data.data;
selectedApp.value = user.value.selectedApplication;
userLoaded.value = true;
} catch (error) {
console.error('Errore nel recupero dei dati utente:', error);
// Puoi anche lanciare un errore se vuoi gestirlo in modo diverso altrove
throw error; // Lancia l'errore per gestirlo fuori dalla funzione, se necessario
} finally {
loadingStore.user_loading = false;
}
}
async function updateSelectedProject(project) {
try {
loadingStore.user_loading = true;