mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-02-04 13:53:18 +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:
parent
225c40f9a6
commit
a4631cda7a
4 changed files with 22 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue