@adlfe/campaign-management-library 2.11.10 → 2.11.11

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.
@@ -33,7 +33,7 @@ import { AngularEditorModule } from '@kolkov/angular-editor';
33
33
  import { NgbPaginationModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
34
34
  import * as echarts from 'echarts';
35
35
  import { Subject, fromEvent, of } from 'rxjs';
36
- import { debounceTime, takeUntil, tap, map, catchError as catchError$1 } from 'rxjs/operators';
36
+ import { debounceTime, takeUntil, tap } from 'rxjs/operators';
37
37
  import { MatChipsModule } from '@angular/material/chips';
38
38
  import { MatNativeDateModule } from '@angular/material/core';
39
39
  import { MatToolbarModule } from '@angular/material/toolbar';
@@ -2849,62 +2849,18 @@ var NewCampaignComponent = /** @class */ (function () {
2849
2849
  configurable: true
2850
2850
  });
2851
2851
  NewCampaignComponent.prototype.saveGeneralInformationService = function () {
2852
- var _a, _b;
2853
2852
  return __awaiter(this, void 0, void 0, function () {
2854
- var bodyReq, payloadValue, isDirectSendEnable, headers, isUtility, confirmation;
2855
- var _this = this;
2856
- return __generator(this, function (_c) {
2857
- switch (_c.label) {
2858
- case 0:
2859
- if (!this.onCheckTwilioCounterValid()) {
2860
- this.toastr.error('Segment cannot more than 10');
2861
- this.isSubmit = false;
2862
- return [2 /*return*/];
2863
- }
2864
- bodyReq = new GeneralInformationWAReqModel().clone(__assign({}, this.generalInformationData));
2865
- payloadValue = bodyReq.convert();
2866
- isDirectSendEnable = (_b = (_a = this.generalInformationData) === null || _a === void 0 ? void 0 : _a.from) === null || _b === void 0 ? void 0 : _b.directSendEnabled;
2867
- if (!isDirectSendEnable) {
2868
- this.saveGeneralInformation(payloadValue);
2869
- return [2 /*return*/];
2870
- }
2871
- headers = new HttpHeaders()
2872
- .set('Authorization', 'Bearer ' + localStorage.getItem('telin.accessToken'))
2873
- .set('Access-Control-Allow-Origin', '*');
2874
- return [4 /*yield*/, this.httpClient
2875
- .post(environment.api + "/message/direct-send/" + bodyReq.accountId, {
2876
- type: 'text',
2877
- text: { body: bodyReq.text },
2878
- }, { headers: headers })
2879
- .pipe(map(function (response) { var _a; return ((_a = response) === null || _a === void 0 ? void 0 : _a.category) === 'UTILITY'; }), catchError$1(function () { return of(true); }))
2880
- .toPromise()];
2881
- case 1:
2882
- isUtility = _c.sent();
2883
- if (isUtility) {
2884
- this.saveGeneralInformation(payloadValue);
2885
- return [2 /*return*/];
2886
- }
2887
- confirmation = new ConfirmationModel();
2888
- confirmation.title = 'Not Utility Content';
2889
- confirmation.content = 'Content mismatch. This content is not Utility content';
2890
- confirmation.btnSubmitRed = 'Continue';
2891
- confirmation.btnCancel = 'Cancel';
2892
- this.dialog
2893
- .open(ConfirmationComponent, {
2894
- autoFocus: false,
2895
- backdropClass: 'overlay-backdrop-dialog',
2896
- data: confirmation,
2897
- })
2898
- .afterClosed()
2899
- .subscribe(function (isContinue) {
2900
- if (isContinue) {
2901
- _this.saveGeneralInformation(payloadValue);
2902
- return;
2903
- }
2904
- _this.isSubmit = false;
2905
- });
2906
- return [2 /*return*/];
2853
+ var bodyReq, payloadValue;
2854
+ return __generator(this, function (_a) {
2855
+ if (!this.onCheckTwilioCounterValid()) {
2856
+ this.toastr.error('Segment cannot more than 10');
2857
+ this.isSubmit = false;
2858
+ return [2 /*return*/];
2907
2859
  }
2860
+ bodyReq = new GeneralInformationWAReqModel().clone(__assign({}, this.generalInformationData));
2861
+ payloadValue = bodyReq.convert();
2862
+ this.saveGeneralInformation(payloadValue);
2863
+ return [2 /*return*/];
2908
2864
  });
2909
2865
  });
2910
2866
  };