mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-14 03:56:24 +00:00
Refactor createFromJson function
This commit is contained in:
parent
061586e258
commit
0a1b44c8dc
6 changed files with 21 additions and 73 deletions
|
|
@ -134,9 +134,7 @@ class InvenTreePurchaseOrder extends InvenTreeModel {
|
|||
}
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
return InvenTreePurchaseOrder.fromJson(json);
|
||||
}
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreePurchaseOrder.fromJson(json);
|
||||
|
||||
/// Mark this order as "placed" / "issued"
|
||||
Future<void> issueOrder() async {
|
||||
|
|
@ -243,9 +241,8 @@ class InvenTreePOLineItem extends InvenTreeModel {
|
|||
Map<String, dynamic> get destinationDetail => getMap("destination_detail");
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
return InvenTreePOLineItem.fromJson(json);
|
||||
}
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreePOLineItem.fromJson(json);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -264,7 +261,6 @@ class InvenTreePurchaseOrderAttachment extends InvenTreeAttachment {
|
|||
String get URL => "order/po/attachment/";
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
return InvenTreePurchaseOrderAttachment.fromJson(json);
|
||||
}
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreePurchaseOrderAttachment.fromJson(json);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue