Many Changes
This commit is contained in:
@@ -72,7 +72,7 @@ const cancelEditorCreate = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const updateCustomer = async () => {
|
||||
const updateItem = async () => {
|
||||
const {error} = await supabase
|
||||
.from("vehicles")
|
||||
.update(itemInfo.value)
|
||||
@@ -80,13 +80,8 @@ const updateCustomer = async () => {
|
||||
if(error) {
|
||||
console.log(error)
|
||||
} else {
|
||||
mode.value = "show"
|
||||
itemInfo.value = {
|
||||
id: 0,
|
||||
name: "",
|
||||
licensePlate: "",
|
||||
type: ""
|
||||
}
|
||||
|
||||
router.push(`/vehicles/show/${currentItem.id}`)
|
||||
toast.add({title: "Fahrzeug erfolgreich gespeichert"})
|
||||
dataStore.fetchVehicles()
|
||||
}
|
||||
@@ -187,7 +182,7 @@ setupPage()
|
||||
<template #footer>
|
||||
<UButton
|
||||
v-if="mode == 'edit'"
|
||||
@click="updateCustomer"
|
||||
@click="updateItem"
|
||||
>
|
||||
Speichern
|
||||
</UButton>
|
||||
|
||||
Reference in New Issue
Block a user