Fix edit problem in PolicyInstanceComponent 90/5890/2
authorelinuxhenrik <henrik.b.andersson@est.tech>
Thu, 15 Apr 2021 08:56:28 +0000 (10:56 +0200)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Thu, 15 Apr 2021 11:19:33 +0000 (13:19 +0200)
Change-Id: I2c5708a0228c765f31b4f3b77d5b117d3b44f950
Issue-ID: NONRTRIC-472
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
webapp-frontend/src/app/policy/policy-instance/policy-instance.component.ts

index 53ab8b1..1649d39 100644 (file)
@@ -154,14 +154,11 @@ export class PolicyInstanceComponent implements OnInit {
   }
 
   modifyInstance(instance: PolicyInstance): void {
-    let refreshedInstance: PolicyInstance;
     this.policySvc
       .getPolicyInstance(instance.policy_id)
-      .subscribe((refreshedJson: any) => {
-        refreshedInstance = refreshedJson;
+      .subscribe((refreshedJson: PolicyInstance) => {
+        this.openInstanceDialog(refreshedJson);
       });
-
-    this.openInstanceDialog(refreshedInstance);
   }
 
   private openInstanceDialog(policy: PolicyInstance) {