Fixed Profile Edit

This commit is contained in:
2024-12-28 14:41:50 +01:00
parent 334ee2f897
commit 98619a9082

View File

@@ -97,6 +97,15 @@ const isLight = computed({
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
}
})
const saveProfile = async () => {
let data = {...itemInfo.value, fullName: itemInfo.value.firstName + ' ' + itemInfo.value.lastName}
delete data.checks
delete data.documents
await dataStore.updateItem('profiles',data,oldItemInfo.value)
}
</script>
<template>
@@ -144,7 +153,7 @@ const isLight = computed({
<div v-if="item.label === 'Informationen'">
<Toolbar>
<UButton
@click="dataStore.updateItem('profiles',{...itemInfo, fullName: itemInfo.firstName + ' ' + itemInfo.lastName},oldItemInfo)"
@click="saveProfile"
>
Speichern
</UButton>
@@ -280,7 +289,7 @@ const isLight = computed({
<div v-if="item.label === 'Vertragsdaten'">
<Toolbar>
<UButton
@click="dataStore.updateItem('profiles',itemInfo)"
@click="saveProfile"
>
Speichern
</UButton>