2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-15 03:35:28 +00:00

Add helpers for boolean functions

This commit is contained in:
Oliver Walters
2023-04-21 19:41:21 +10:00
parent f253234b94
commit 88a02eb9ef
2 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,7 @@
### 0.11.6 - April 2023
---
- Add support for Project Codes
- Fix action button colors
- Added Norwegian translations
- Fix serial number field when creating stock item

View File

@ -1365,6 +1365,12 @@ class InvenTreeAPI {
}
}
// Return a boolean global setting value
Future<bool> getGlobalBooleanSetting(String key) async {
String value = await getGlobalSetting(key);
return value.toLowerCase() == "true";
}
Future<String> getUserSetting(String key) async {
if (!supportsSettings) return "";
@ -1385,6 +1391,12 @@ class InvenTreeAPI {
}
}
// Return a boolean user setting value
Future<bool> getUserBooleanSetting(String key) async {
String value = await getUserSetting(key);
return value.toLowerCase() == "true";
}
/*
* Send a request to the server to locate / identify either a StockItem or StockLocation
*/