mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Add framework for future self to check server compatibility
This commit is contained in:
parent
c7f504fb44
commit
aad616aea1
12
lib/api.dart
12
lib/api.dart
@ -21,6 +21,14 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
|
|
||||||
class InvenTreeAPI {
|
class InvenTreeAPI {
|
||||||
|
|
||||||
|
// Minimum supported InvenTree server version is 0.1.1
|
||||||
|
static const List<int> MIN_SUPPORTED_VERSION = [0, 1, 1];
|
||||||
|
|
||||||
|
bool _checkServerVersion(String version) {
|
||||||
|
// TODO - Decode the provided version string and determine if the server is "new" enough
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Endpoint for requesting an API token
|
// Endpoint for requesting an API token
|
||||||
static const _URL_GET_TOKEN = "user/token/";
|
static const _URL_GET_TOKEN = "user/token/";
|
||||||
static const _URL_GET_VERSION = "";
|
static const _URL_GET_VERSION = "";
|
||||||
@ -219,6 +227,10 @@ class InvenTreeAPI {
|
|||||||
|
|
||||||
_version = data["version"];
|
_version = data["version"];
|
||||||
|
|
||||||
|
if (!_checkServerVersion(_version)) {
|
||||||
|
// TODO - Something?
|
||||||
|
}
|
||||||
|
|
||||||
// Record the instance name of the server
|
// Record the instance name of the server
|
||||||
instance = data['instance'] ?? '';
|
instance = data['instance'] ?? '';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user