create dashboard
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user