mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Start of unit tests for the actual API code
This commit is contained in:
parent
62b0fcbec5
commit
e424a3cf7b
6 changed files with 103 additions and 51 deletions
|
|
@ -201,6 +201,8 @@ class InvenTreeAPI {
|
|||
// Authentication token (initially empty, must be requested)
|
||||
String _token = "";
|
||||
|
||||
bool get hasToken => _token.isNotEmpty;
|
||||
|
||||
/*
|
||||
* Check server connection and display messages if not connected.
|
||||
* Useful as a precursor check before performing operations.
|
||||
|
|
@ -278,7 +280,7 @@ class InvenTreeAPI {
|
|||
bool _connecting = false;
|
||||
|
||||
bool isConnected() {
|
||||
return profile != null && _connected && baseUrl.isNotEmpty && _token.isNotEmpty;
|
||||
return profile != null && _connected && baseUrl.isNotEmpty && hasToken;
|
||||
}
|
||||
|
||||
bool isConnecting() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue