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' 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> </script>
<template> <template>
@@ -144,7 +153,7 @@ const isLight = computed({
<div v-if="item.label === 'Informationen'"> <div v-if="item.label === 'Informationen'">
<Toolbar> <Toolbar>
<UButton <UButton
@click="dataStore.updateItem('profiles',{...itemInfo, fullName: itemInfo.firstName + ' ' + itemInfo.lastName},oldItemInfo)" @click="saveProfile"
> >
Speichern Speichern
</UButton> </UButton>
@@ -280,7 +289,7 @@ const isLight = computed({
<div v-if="item.label === 'Vertragsdaten'"> <div v-if="item.label === 'Vertragsdaten'">
<Toolbar> <Toolbar>
<UButton <UButton
@click="dataStore.updateItem('profiles',itemInfo)" @click="saveProfile"
> >
Speichern Speichern
</UButton> </UButton>