@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.
@@ -3028,62 +3028,18 @@
3028
3028
  configurable: true
3029
3029
  });
3030
3030
  NewCampaignComponent.prototype.saveGeneralInformationService = function () {
3031
- var _a, _b;
3032
3031
  return __awaiter(this, void 0, void 0, function () {
3033
- var bodyReq, payloadValue, isDirectSendEnable, headers, isUtility, confirmation;
3034
- var _this = this;
3035
- return __generator(this, function (_c) {
3036
- switch (_c.label) {
3037
- case 0:
3038
- if (!this.onCheckTwilioCounterValid()) {
3039
- this.toastr.error('Segment cannot more than 10');
3040
- this.isSubmit = false;
3041
- return [2 /*return*/];
3042
- }
3043
- bodyReq = new GeneralInformationWAReqModel().clone(__assign({}, this.generalInformationData));
3044
- payloadValue = bodyReq.convert();
3045
- isDirectSendEnable = (_b = (_a = this.generalInformationData) === null || _a === void 0 ? void 0 : _a.from) === null || _b === void 0 ? void 0 : _b.directSendEnabled;
3046
- if (!isDirectSendEnable) {
3047
- this.saveGeneralInformation(payloadValue);
3048
- return [2 /*return*/];
3049
- }
3050
- headers = new http.HttpHeaders()
3051
- .set('Authorization', 'Bearer ' + localStorage.getItem('telin.accessToken'))
3052
- .set('Access-Control-Allow-Origin', '*');
3053
- return [4 /*yield*/, this.httpClient
3054
- .post(environment.api + "/message/direct-send/" + bodyReq.accountId, {
3055
- type: 'text',
3056
- text: { body: bodyReq.text },
3057
- }, { headers: headers })
3058
- .pipe(operators.map(function (response) { var _a; return ((_a = response) === null || _a === void 0 ? void 0 : _a.category) === 'UTILITY'; }), operators.catchError(function () { return rxjs.of(true); }))
3059
- .toPromise()];
3060
- case 1:
3061
- isUtility = _c.sent();
3062
- if (isUtility) {
3063
- this.saveGeneralInformation(payloadValue);
3064
- return [2 /*return*/];
3065
- }
3066
- confirmation = new ConfirmationModel();
3067
- confirmation.title = 'Not Utility Content';
3068
- confirmation.content = 'Content mismatch. This content is not Utility content';
3069
- confirmation.btnSubmitRed = 'Continue';
3070
- confirmation.btnCancel = 'Cancel';
3071
- this.dialog
3072
- .open(ConfirmationComponent, {
3073
- autoFocus: false,
3074
- backdropClass: 'overlay-backdrop-dialog',
3075
- data: confirmation,
3076
- })
3077
- .afterClosed()
3078
- .subscribe(function (isContinue) {
3079
- if (isContinue) {
3080
- _this.saveGeneralInformation(payloadValue);
3081
- return;
3082
- }
3083
- _this.isSubmit = false;
3084
- });
3085
- return [2 /*return*/];
3032
+ var bodyReq, payloadValue;
3033
+ return __generator(this, function (_a) {
3034
+ if (!this.onCheckTwilioCounterValid()) {
3035
+ this.toastr.error('Segment cannot more than 10');
3036
+ this.isSubmit = false;
3037
+ return [2 /*return*/];
3086
3038
  }
3039
+ bodyReq = new GeneralInformationWAReqModel().clone(__assign({}, this.generalInformationData));
3040
+ payloadValue = bodyReq.convert();
3041
+ this.saveGeneralInformation(payloadValue);
3042
+ return [2 /*return*/];
3087
3043
  });
3088
3044
  });
3089
3045
  };