Changes
This commit is contained in:
@@ -405,6 +405,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
|
||||
if(supabaseError) {
|
||||
console.log(supabaseError)
|
||||
toast.add({title: "Es ist ein Fehler bei der Erstellung aufgetreten", color: "rose"})
|
||||
} else if (supabaseData) {
|
||||
await eval( dataType + '.value.push(' + JSON.stringify(...supabaseData) + ')')
|
||||
toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`})
|
||||
@@ -425,7 +426,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
} else if(supabaseData) {
|
||||
await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0]))
|
||||
toast.add({title: `${dataTypes[dataType].labelSingle} gespeichert`})
|
||||
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${supabaseData[0].id}`)
|
||||
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${data.id}`)
|
||||
return supabaseData
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user