mirror of
https://github.com/inventree/inventree-app.git
synced 2025-07-11 08:04:14 +00:00
Modern attachments (#505)
* Minimum API version is now 100 * Remove old API features - Anything below API v100 no longer supported * Reefactor attachment widget to support modern attachment API * Filter and display attachments correctly * Refactor
This commit is contained in:
@ -635,11 +635,13 @@ class InvenTreeStockItemAttachment extends InvenTreeAttachment {
|
||||
String get REFERENCE_FIELD => "stock_item";
|
||||
|
||||
@override
|
||||
String get URL => "stock/attachment/";
|
||||
String get REF_MODEL_TYPE => "stockitem";
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreeStockItemAttachment.fromJson(json);
|
||||
String get URL => InvenTreeAPI().supportsModernAttachments ? "attachment/" : "stock/attachment/";
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreeStockItemAttachment.fromJson(json);
|
||||
}
|
||||
|
||||
|
||||
@ -669,10 +671,6 @@ class InvenTreeStockLocation extends InvenTreeModel {
|
||||
"structural": {},
|
||||
};
|
||||
|
||||
if (!api.supportsStructuralCategories) {
|
||||
fields.remove("structural");
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user