mirror of
https://github.com/inventree/inventree-app.git
synced 2026-01-22 10:49:41 +00:00
List filtering fix (#746)
* Bug fix for API forms without URL - Ensure submitted data is returned * Translate search fields * Update release notes * Remove debug message * dart format
This commit is contained in:
@@ -1011,17 +1011,16 @@ Future<void> launchApiForm(
|
||||
APIFormWidgetState? formHandler,
|
||||
IconData icon = TablerIcons.device_floppy,
|
||||
}) async {
|
||||
showLoadingOverlay();
|
||||
|
||||
// List of fields defined by the server
|
||||
Map<String, dynamic> serverFields = {};
|
||||
|
||||
if (url.isNotEmpty) {
|
||||
showLoadingOverlay();
|
||||
var options = await InvenTreeAPI().options(url);
|
||||
hideLoadingOverlay();
|
||||
|
||||
// Invalid response from server
|
||||
if (!options.isValid()) {
|
||||
hideLoadingOverlay();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1030,8 +1029,6 @@ Future<void> launchApiForm(
|
||||
if (serverFields.isEmpty) {
|
||||
// User does not have permission to perform this action
|
||||
showSnackIcon(L10().response403, icon: TablerIcons.user_x);
|
||||
|
||||
hideLoadingOverlay();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1075,6 +1072,8 @@ Future<void> launchApiForm(
|
||||
formFields.add(field);
|
||||
}
|
||||
|
||||
showLoadingOverlay();
|
||||
|
||||
// Grab existing data for each form field
|
||||
for (var field in formFields) {
|
||||
await field.loadInitialData();
|
||||
@@ -1430,7 +1429,7 @@ class APIFormWidgetState extends State<APIFormWidget> {
|
||||
// Perhaps we just want to process the data?
|
||||
if (widget.url.isEmpty) {
|
||||
// Hide the form
|
||||
handleSuccess(data, {});
|
||||
handleSuccess(data, data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user