fix: workflow 422 validation + report 500 DB data fetching + AI stream tenant context
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user