@@ -619,8 +637,6 @@ const loadContacts = async () => {
// API Platform gibt hydra:member zurück
contacts.value = data['hydra:member'] || data.member || []
-
- console.log('Loaded contacts:', contacts.value.length, 'with filter:', typeFilter.value)
} catch (error) {
console.error('Error loading contacts:', error)
toast.add({
@@ -718,7 +734,17 @@ const saveContact = async () => {
if (!response.ok) {
const error = await response.json()
- throw new Error(error.message || 'Fehler beim Speichern')
+
+ // API Platform liefert Validierungsfehler in 'violations' Array
+ if (error.violations && error.violations.length > 0) {
+ const errorMessages = error.violations
+ .map(v => `${v.propertyPath}: ${v.message}`)
+ .join('\n')
+ throw new Error(errorMessages)
+ }
+
+ // Fallback für andere Fehlerformate
+ throw new Error(error['hydra:description'] || error.message || error.detail || 'Fehler beim Speichern')
}
toast.add({
@@ -736,7 +762,7 @@ const saveContact = async () => {
severity: 'error',
summary: 'Fehler',
detail: error.message || 'Kontakt konnte nicht gespeichert werden',
- life: 3000
+ life: 5000
})
} finally {
saving.value = false
diff --git a/src/Entity/Contact.php b/src/Entity/Contact.php
index ed93d47..8f093ad 100644
--- a/src/Entity/Contact.php
+++ b/src/Entity/Contact.php
@@ -291,7 +291,7 @@ class Contact
return $this;
}
- public function isDebtor(): bool
+ public function getIsDebtor(): bool
{
return $this->isDebtor;
}
@@ -303,7 +303,7 @@ class Contact
return $this;
}
- public function isCreditor(): bool
+ public function getIsCreditor(): bool
{
return $this->isCreditor;
}