fix: workflow 422 validation + report 500 DB data fetching + AI stream tenant context
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-07-30 10:54:28 +02:00
parent 3f2f594847
commit 2cd3f30f82
2 changed files with 110 additions and 7 deletions
@@ -131,6 +131,11 @@ export function WorkflowEditor({ open, workflow, onClose }: WorkflowEditorProps)
return;
}
if (form.steps.length === 0) {
toast.error('Mindestens ein Schritt ist erforderlich');
return;
}
const hasEmptyStepName = form.steps.some((s) => !s.name.trim());
if (hasEmptyStepName) {
toast.error('Alle Schritte muessen einen Namen haben');
@@ -161,7 +166,17 @@ export function WorkflowEditor({ open, workflow, onClose }: WorkflowEditorProps)
}
onClose();
} catch (err: any) {
toast.error(err.message || 'Fehler beim Speichern');
// Show detailed validation errors from backend (422)
if (err.validationErrors) {
const details = Object.entries(err.validationErrors)
.map(([field, msgs]) => `${field}: ${msgs.join(', ')}`)
.join('; ');
toast.error(`Validierungsfehler: ${details}`);
} else if (err.detail) {
toast.error(err.detail);
} else {
toast.error(err.message || 'Fehler beim Speichern');
}
}
};