diff --git a/assets/release_notes.md b/assets/release_notes.md index e1aa0069..7c7b3a71 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -4,6 +4,7 @@ ### 0.10.0 - February 2023 --- +- Updates to match latest server API - Bug fix for empty HttpResponse from server ### 0.9.2 - December 2022 diff --git a/lib/inventree/model.dart b/lib/inventree/model.dart index 9ba2e8c1..e2fe9808 100644 --- a/lib/inventree/model.dart +++ b/lib/inventree/model.dart @@ -679,7 +679,19 @@ class InvenTreePlugin extends InvenTreeModel { } @override - String get URL => "plugin/"; + String get URL { + + /* Note: The plugin API endpoint changed at API version 90, + * < 90 = 'plugin' + * >= 90 = 'plugins' + * Ref: https://github.com/inventree/InvenTree/pull/4186 + */ + if (api.isConnected() && api.apiVersion < 90) { + return "plugin/"; + } else { + return "plugins/"; + } + } String get key => (jsondata["key"] ?? "") as String;