mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Extract API version from server info
This commit is contained in:
parent
6e115dd3bf
commit
7f69c1d6d4
1 changed files with 5 additions and 0 deletions
|
|
@ -135,6 +135,9 @@ class InvenTreeAPI {
|
||||||
// Server version information
|
// Server version information
|
||||||
String _version = '';
|
String _version = '';
|
||||||
|
|
||||||
|
// API version of the connected server
|
||||||
|
int _apiVersion = 1;
|
||||||
|
|
||||||
// Getter for server version information
|
// Getter for server version information
|
||||||
String get version => _version;
|
String get version => _version;
|
||||||
|
|
||||||
|
|
@ -247,6 +250,8 @@ class InvenTreeAPI {
|
||||||
_version = data["version"];
|
_version = data["version"];
|
||||||
instance = data['instance'] ?? '';
|
instance = data['instance'] ?? '';
|
||||||
|
|
||||||
|
// Default API version is 1 if not provided
|
||||||
|
_apiVersion = data['apiVersion'] as int ?? 1;
|
||||||
// Check that the remote server version is *new* enough
|
// Check that the remote server version is *new* enough
|
||||||
if (!_checkServerVersion(_version)) {
|
if (!_checkServerVersion(_version)) {
|
||||||
showServerError(
|
showServerError(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue