Added Bank Account Updating
This commit is contained in:
@@ -74,6 +74,16 @@ const addAccount = async (account) => {
|
||||
}
|
||||
}
|
||||
|
||||
const updateAccount = async (account) => {
|
||||
const {data,error} = await supabase.from("bankaccounts").update({accountId: account.id}).eq("iban",account.iban).select()
|
||||
if(error) {
|
||||
console.log(error)
|
||||
toast.add({title: "Es gab einen Fehler bei aktualisieren des Accounts", color:"rose"})
|
||||
} else if(data) {
|
||||
toast.add({title: "Account erfolgreich aktualisiert"})
|
||||
}
|
||||
}
|
||||
|
||||
setupPage()
|
||||
</script>
|
||||
|
||||
@@ -148,6 +158,12 @@ setupPage()
|
||||
>
|
||||
+ Konto
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="updateAccount(account)"
|
||||
v-else
|
||||
>
|
||||
Aktualisieren
|
||||
</UButton>
|
||||
</div>
|
||||
|
||||
<!-- <UButton @click="setupPage">Setup</UButton>
|
||||
|
||||
Reference in New Issue
Block a user