mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-17 04:35:26 +00:00
Fix URL getters
This commit is contained in:
@ -13,7 +13,7 @@ class InvenTreeCompany extends InvenTreeModel {
|
||||
String NAME = "Company";
|
||||
|
||||
@override
|
||||
String URL = "company/";
|
||||
String get URL => "company/";
|
||||
|
||||
InvenTreeCompany() : super();
|
||||
|
||||
@ -49,7 +49,7 @@ class InvenTreeCompany extends InvenTreeModel {
|
||||
*/
|
||||
class InvenTreeSupplierPart extends InvenTreeModel {
|
||||
@override
|
||||
String URL = "company/part/";
|
||||
String get URL => "company/part/";
|
||||
|
||||
Map<String, String> _filters() {
|
||||
return {
|
||||
|
@ -37,7 +37,7 @@ class InvenTreePageResponse {
|
||||
class InvenTreeModel {
|
||||
|
||||
// Override the endpoint URL for each subclass
|
||||
String URL = "";
|
||||
String get URL => "";
|
||||
|
||||
// Override the web URL for each subclass
|
||||
// Note: If the WEB_URL is the same (except for /api/) as URL then just leave blank
|
||||
|
@ -14,7 +14,7 @@ class InvenTreePartCategory extends InvenTreeModel {
|
||||
String NAME = "PartCategory";
|
||||
|
||||
@override
|
||||
String URL = "part/category/";
|
||||
String get URL => "part/category/";
|
||||
|
||||
@override
|
||||
Map<String, String> defaultListFilters() {
|
||||
@ -68,7 +68,7 @@ class InvenTreePartTestTemplate extends InvenTreeModel {
|
||||
String NAME = "PartTestTemplate";
|
||||
|
||||
@override
|
||||
String URL = "part/test-template/";
|
||||
String get URL => "part/test-template/";
|
||||
|
||||
String get key => jsondata['key'] ?? '';
|
||||
|
||||
@ -125,7 +125,7 @@ class InvenTreePart extends InvenTreeModel {
|
||||
String NAME = "Part";
|
||||
|
||||
@override
|
||||
String URL = "part/";
|
||||
String get URL => "part/";
|
||||
|
||||
@override
|
||||
Map<String, String> defaultListFilters() {
|
||||
|
@ -18,7 +18,7 @@ class InvenTreeStockItemTestResult extends InvenTreeModel {
|
||||
String NAME = "StockItemTestResult";
|
||||
|
||||
@override
|
||||
String URL = "stock/test/";
|
||||
String get URL => "stock/test/";
|
||||
|
||||
String get key => jsondata['key'] ?? '';
|
||||
|
||||
@ -103,7 +103,7 @@ class InvenTreeStockItem extends InvenTreeModel {
|
||||
String NAME = "StockItem";
|
||||
|
||||
@override
|
||||
String URL = "stock/";
|
||||
String get URL => "stock/";
|
||||
|
||||
@override
|
||||
String WEB_URL = "stock/item/";
|
||||
@ -540,7 +540,7 @@ class InvenTreeStockLocation extends InvenTreeModel {
|
||||
String NAME = "StockLocation";
|
||||
|
||||
@override
|
||||
String URL = "stock/location/";
|
||||
String get URL => "stock/location/";
|
||||
|
||||
String get pathstring => jsondata['pathstring'] ?? '';
|
||||
|
||||
|
Reference in New Issue
Block a user