This commit is contained in:
Florinda
2024-10-28 10:00:08 +01:00
36 changed files with 80 additions and 14895 deletions

View File

@@ -41,11 +41,11 @@ export const ScenarioStore = defineStore('scenario_store', () => {
async function fetchApplicationScenarios() {
loadingStore.scenario_loading = true;
console.log("fetchApplicationScenarios >= selectedApp", userPrefStore.selectedApp) ;
await ScenarioService.getScenariosApplication(userPrefStore.selectedApp).then(resp=>{
console.log("response scenari", resp);
applicationScenarios.value = resp.data
allScenarios.value = [...projectScenarios.value, ...applicationScenarios.value]
allScenarios.value = [...projectScenarios.value, ...applicationScenarios.value]
loadingStore.scenario_loading = false;
})

View File

@@ -18,6 +18,7 @@ export const UserPrefStore = defineStore('userpref_store', () => {
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) => {
@@ -29,11 +30,8 @@ export const UserPrefStore = defineStore('userpref_store', () => {
try {
loadingStore.user_loading = true;
selectedApp.value = null;
// Aspetta che l'aggiornamento del progetto finisca
await ProjectService.updateSelectedProject(project);
} catch (error) {
console.error("Errore durante l'aggiornamento del progetto:", error);
@@ -46,8 +44,11 @@ export const UserPrefStore = defineStore('userpref_store', () => {
function setSelectedApp(app){
async function setSelectedApp(app){
loadingStore.user_loading = true;
await ProjectService.updateSelectedApplication(app);
selectedApp.value = app;
loadingStore.user_loading = false;
}
const selectedProject = computed(() => user.value.selectedProject)