Restructured Update Process Into Store

This commit is contained in:
2024-01-15 21:54:12 +01:00
parent 9f5a142680
commit 497d768d4e
20 changed files with 176 additions and 918 deletions

View File

@@ -41,25 +41,6 @@ const cancelEditorCreate = () => {
router.push(`/vendors/`)
}
const updateItem = async () => {
const {error} = await supabase
.from("vendors")
.update(itemInfo.value)
.eq('id',itemInfo.value.id)
if(error) {
console.log(error)
} else {
toast.add({title: "Lieferant erfolgreich gespeichert"})
router.push(`/vendors/show/${currentItem.value.id}`)
dataStore.fetchVendors()
}
}
setupPage()
</script>
@@ -196,7 +177,7 @@ setupPage()
<template #footer>
<UButton
v-if="mode == 'edit'"
@click="updateItem"
@click="dataStore.updateItem('vendors',itemInfo)"
>
Speichern
</UButton>