Many Changes in Navigation, Shortcuts, Search and Data Pulling directly from Supabase

This commit is contained in:
2024-06-05 14:34:23 +02:00
parent e139eb771c
commit bc24f49476
27 changed files with 779 additions and 337 deletions

View File

@@ -813,7 +813,12 @@ export const useDataStore = defineStore('data', () => {
} else if (supabaseData) {
console.log(supabaseData)
await generateHistoryItems(dataType, supabaseData[0])
//await eval( dataType + '.value.push(' + JSON.stringify(...supabaseData) + ')')
if(dataType !== "statementallocations"){
await eval( dataType + '.value.push(' + JSON.stringify(...supabaseData) + ')')
}
toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`})
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${supabaseData[0].id}`)
return supabaseData
@@ -1450,8 +1455,12 @@ export const useDataStore = defineStore('data', () => {
//Get Item By Id
const getProductById = computed(() => (itemId) => {
return products.value.find(item => item.id === itemId)
const getProductById = computed(() => async (itemId) => {
return await useSupabaseSelectSingle("products",itemId, "*")
//return products.value.find(item => item.id === itemId)
})
const getServiceById = computed(() => (itemId) => {