mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +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:
parent
c3eb1a5fca
commit
e837394495
18 changed files with 151 additions and 167 deletions
|
|
@ -36,10 +36,6 @@ class InvenTreePartCategory extends InvenTreeModel {
|
|||
"structural": {},
|
||||
};
|
||||
|
||||
if (!api.supportsStructuralCategories) {
|
||||
fields.remove("structural");
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
|
@ -475,7 +471,10 @@ class InvenTreePartAttachment extends InvenTreeAttachment {
|
|||
String get REFERENCE_FIELD => "part";
|
||||
|
||||
@override
|
||||
String get URL => "part/attachment/";
|
||||
String get REF_MODEL_TYPE => "part";
|
||||
|
||||
@override
|
||||
String get URL => InvenTreeAPI().supportsModernAttachments ? "attachment/" : "part/attachment/";
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreePartAttachment.fromJson(json);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue