From 9f7a9acede079d421516a76ab3ab208d8b67ed4c Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 29 Feb 2024 14:59:13 +0300 Subject: [PATCH] asset room model fix --- lib/models/device/asset_by_id_model.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/models/device/asset_by_id_model.dart b/lib/models/device/asset_by_id_model.dart index a91dc539..618a90cb 100644 --- a/lib/models/device/asset_by_id_model.dart +++ b/lib/models/device/asset_by_id_model.dart @@ -20,7 +20,7 @@ class AssetByIdModel { AssetReplace building; AssetReplace floor; Department department; - String room; + Lookup room; int testsDay; num purchasingPrice; String nbv; @@ -133,7 +133,6 @@ class AssetByIdModel { }); } id = json['id']; - print("supplier:${json['supplier']}"); modelDefinition = json['modelDefinition'] != null ? new ModelDefinition.fromJson(json['modelDefinition']) : null; supplier = json['supplier'] != null ? Suppliers.fromJson(json['supplier']) : null; ipAddress = json['ipAddress']; @@ -150,7 +149,7 @@ class AssetByIdModel { building = json['building'] != null ? new AssetReplace.fromJson(json['building']) : null; floor = json['floor'] != null ? new AssetReplace.fromJson(json['floor']) : null; department = json['department'] != null ? new Department.fromJson(json['department']) : null; - room = json['room']; + room = json['room'] != null ? new Lookup.fromJson(json['room']) : null; testsDay = json['testsDay']; purchasingPrice = json['purchasingPrice']; nbv = json['nbv']; @@ -244,7 +243,7 @@ class AssetByIdModel { if (this.department != null) { data['department'] = this.department.toJson(); } - data['room'] = this.room; + data['room'] = this.room.toJson(); data['testsDay'] = this.testsDay; data['purchasingPrice'] = this.purchasingPrice; data['nbv'] = this.nbv;