mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +00:00
Display error message when form submission returns error
This commit is contained in:
@ -597,12 +597,14 @@ class _APIFormWidgetState extends State<APIFormWidget> {
|
||||
if (method == "POST") {
|
||||
return await InvenTreeAPI().post(
|
||||
url,
|
||||
body: data
|
||||
body: data,
|
||||
expectedStatusCode: null
|
||||
);
|
||||
} else {
|
||||
return await InvenTreeAPI().patch(
|
||||
url,
|
||||
body: data,
|
||||
expectedStatusCode: null
|
||||
);
|
||||
}
|
||||
|
||||
@ -660,6 +662,10 @@ class _APIFormWidgetState extends State<APIFormWidget> {
|
||||
return;
|
||||
case 400:
|
||||
// Form submission / validation error
|
||||
showSnackIcon(
|
||||
L10().error,
|
||||
success: false
|
||||
);
|
||||
|
||||
// Update field errors
|
||||
for (var field in fields) {
|
||||
|
Reference in New Issue
Block a user