From 02beb31e4326211e3f5a4b1928da0a97d8038c46 Mon Sep 17 00:00:00 2001 From: flfeders Date: Sun, 14 Jul 2024 21:27:29 +0200 Subject: [PATCH] Changed Docker Loading --- stores/data.js | 82 ++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/stores/data.js b/stores/data.js index cd7c7f7..8873837 100644 --- a/stores/data.js +++ b/stores/data.js @@ -292,6 +292,9 @@ export const useDataStore = defineStore('data', () => { currentTenant.value = activeProfile.value.tenant await fetchData() + + //loaded.value = true + } else { await fetchOwnProfiles() await fetchTenants() @@ -339,44 +342,44 @@ export const useDataStore = defineStore('data', () => { await fetchOwnTenant() //loaded.value = true - await fetchDocuments() - await fetchEvents() - await fetchTasks() - await fetchProjects() - await fetchTimes() - await fetchCustomers() - await fetchContracts() - await fetchContacts() - await fetchForms() - await fetchFormSubmits() - await fetchProducts() - await fetchUnits() - await fetchMovements() - await fetchSpaces() - await fetchVehicles() - await fetchVendors() - await fetchIncomingInvoices() - await fetchBankAccounts() - await fetchBankStatements() - await fetchBankRequisitions() - await fetchHistoryItems() - await fetchNumberRanges() - await fetchNotifications() - await fetchAbsenceRequests() - await fetchAccounts() - await fetchTaxTypes() - await fetchPlants() - await fetchInventoryItems() - await fetchChats() - await fetchMessages() - await fetchCreatedDocuments() - await fetchWorkingTimes() - await fetchPhasesTemplates() - await fetchEmailAccounts() - await fetchTextTemplates() - await fetchServices() - await fetchServiceCategories() - await fetchResources() + // await fetchDocuments() + // await fetchEvents() + // await fetchTasks() + // await fetchProjects() + // await fetchTimes() + // await fetchCustomers() + // await fetchContracts() + // await fetchContacts() + // await fetchForms() + // await fetchFormSubmits() + // await fetchProducts() + // await fetchUnits() + // await fetchMovements() + // await fetchSpaces() + // await fetchVehicles() + // await fetchVendors() + // await fetchIncomingInvoices() + // await fetchBankAccounts() + // await fetchBankStatements() + // await fetchBankRequisitions() + // await fetchHistoryItems() + // await fetchNumberRanges() + // await fetchNotifications() + // await fetchAbsenceRequests() + // await fetchAccounts() + // await fetchTaxTypes() + // await fetchPlants() + // await fetchInventoryItems() + // await fetchChats() + // await fetchMessages() + // await fetchCreatedDocuments() + // await fetchWorkingTimes() + // await fetchPhasesTemplates() + // await fetchEmailAccounts() + // await fetchTextTemplates() + // await fetchServices() + // await fetchServiceCategories() + // await fetchResources() loaded.value = true @@ -821,6 +824,7 @@ export const useDataStore = defineStore('data', () => { } async function updateItem (dataType, data, oldData = null) { + console.log(dataType, data) //Temporary Fix TODO: Remove and build Solution data = JSON.parse(JSON.stringify(data)) delete data.users @@ -845,7 +849,7 @@ export const useDataStore = defineStore('data', () => { console.log(supabaseError) toast.add({title: `Fehler beim Speichern`, color: 'rose'}) } else if(supabaseData) { - await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0])) + //await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0])) if(dataType === 'profiles') await fetchProfiles() toast.add({title: `${dataTypes[dataType].labelSingle} gespeichert`}) if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${data.id}`)