vcomply-workflow-engine 2.6.92 → 2.6.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1729,7 +1729,7 @@
1729
1729
  AddRiskService.prototype.addRisk = function (payload) {
1730
1730
  var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
1731
1731
  return this.http
1732
- .post(this.env.riskPost + 'risk/CreateRisk', payload, { headers: headers })
1732
+ .post(this.env.risk + 'risk/CreateRisk', payload, { headers: headers })
1733
1733
  .pipe(operators.retry(2));
1734
1734
  };
1735
1735
  AddRiskService.prototype.addBulkRisk = function (payload) {
@@ -1745,7 +1745,7 @@
1745
1745
  AddRiskService.prototype.updateRisk = function (riskId, payload) {
1746
1746
  var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
1747
1747
  return this.http
1748
- .post(this.env.riskPost + 'risk/CreateRisk&RiskId=' + riskId, payload, { headers: headers })
1748
+ .post(this.env.risk + 'risk/CreateRisk&RiskId=' + riskId, payload, { headers: headers })
1749
1749
  .pipe(operators.retry(2));
1750
1750
  };
1751
1751
  return AddRiskService;
@@ -2400,6 +2400,7 @@
2400
2400
  }
2401
2401
  };
2402
2402
  WorkflowRiskComponent.prototype.createRisk = function (riskForm) {
2403
+ var _this = this;
2403
2404
  var _a, _b, _c, _d, _e, _f, _g, _h;
2404
2405
  this.loader = true;
2405
2406
  this.uiKitService.isLoader = false;
@@ -2439,42 +2440,38 @@
2439
2440
  risk_label: (riskForm === null || riskForm === void 0 ? void 0 : riskForm.addRiskLabel) ? riskForm === null || riskForm === void 0 ? void 0 : riskForm.riskLabelValue : 1,
2440
2441
  };
2441
2442
  console.log("payloadpayloadpayloadpayload", payload);
2442
- // if (this.mode == 'CREATE') {
2443
- // this.riskService.addRisk(payload).subscribe((res: any) => {
2444
- // console.log(res);
2445
- // this.riskData = res;
2446
- // this.riskId = res._id;
2447
- // this.loader = false;
2448
- // this.uiKitService.isLoader = false;
2449
- // this.showSmiley = true;
2450
- // this.uiKitService.isSmileyOn = true;
2451
- // // this.resetForm();
2452
- // },
2453
- // err => {
2454
- // console.log(err);
2455
- // this.loader = false;
2456
- // this.uiKitService.isLoader = false;
2457
- // this.snackBar.show('OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?', 'alert');
2458
- // }
2459
- // );
2460
- // }
2461
- // if (this.mode == 'EDIT' && this.openedFrom !== 'MOVE_TO_REGISTER') {
2462
- // this.smileyMessage = `The risk has been modified.`;
2463
- // this.riskService.updateRisk(this.riskId, payload).subscribe((res: any) => {
2464
- // this.riskData = res;
2465
- // this.showSmiley = true;
2466
- // this.uiKitService.isSmileyOn = true;
2467
- // this.loader = false;
2468
- // this.uiKitService.isLoader = false;
2469
- // },
2470
- // err => {
2471
- // console.log(err);
2472
- // this.loader = false;
2473
- // this.uiKitService.isLoader = false;
2474
- // this.snackBar.show('OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?', 'alert');
2475
- // }
2476
- // );
2477
- // }
2443
+ if (this.mode == 'CREATE') {
2444
+ this.riskService.addRisk(payload).subscribe(function (res) {
2445
+ console.log(res);
2446
+ _this.riskData = res;
2447
+ _this.riskId = res._id;
2448
+ _this.loader = false;
2449
+ _this.uiKitService.isLoader = false;
2450
+ _this.showSmiley = true;
2451
+ _this.uiKitService.isSmileyOn = true;
2452
+ // this.resetForm();
2453
+ }, function (err) {
2454
+ console.log(err);
2455
+ _this.loader = false;
2456
+ _this.uiKitService.isLoader = false;
2457
+ _this.snackBar.show('OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?', 'alert');
2458
+ });
2459
+ }
2460
+ if (this.mode == 'EDIT' && this.openedFrom !== 'MOVE_TO_REGISTER') {
2461
+ this.smileyMessage = "The risk has been modified.";
2462
+ this.riskService.updateRisk(this.riskId, payload).subscribe(function (res) {
2463
+ _this.riskData = res;
2464
+ _this.showSmiley = true;
2465
+ _this.uiKitService.isSmileyOn = true;
2466
+ _this.loader = false;
2467
+ _this.uiKitService.isLoader = false;
2468
+ }, function (err) {
2469
+ console.log(err);
2470
+ _this.loader = false;
2471
+ _this.uiKitService.isLoader = false;
2472
+ _this.snackBar.show('OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?', 'alert');
2473
+ });
2474
+ }
2478
2475
  if (this.openedFrom === 'MOVE_TO_REGISTER') {
2479
2476
  this.closeWorkflow.emit({ evt: { action: 'MOVE_TO_REGISTER', payload: payload }, confirm: false });
2480
2477
  }