Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- submit() {
- this.touchFormGroup(this.form);
- if (this.form.valid) {
- if (this.submitLock) {
- console.log("lock");
- return;
- }
- this.submitLock = true;
- this.changeSuccess = false;
- this.changeFailure = false;
- this.bankAccountService.isAccountBankCodeChangeLocked().subscribe(isLocked => {
- if (isLocked) {
- this.modalService.verifySmsCode().then(() => {
- this.form.value.Phone1 = "+" + this.form.value.Phone1Prefix + this.form.value.Phone1;
- this.userService.changePersonalData(this.form.value).subscribe(result => {
- if (result) {
- this.changeSuccess = true;
- ga('send', 'event', 'user', 'zapisano-dane-użytkownika', null, null, this.form.value);
- this.load();
- this.submitLock = false;
- } else {
- this.changeFailure = true;
- this.submitLock = false;
- }
- });
- }, error => {
- this.errorMessageId = error;
- this.submitLock = false;
- });
- }
- else {
- this.form.value.Phone1 = "+" + this.form.value.Phone1Prefix + this.form.value.Phone1;
- this.userService.changePersonalData(this.form.value).subscribe(result => {
- if (result) {
- this.changeSuccess = true;
- ga('send', 'event', 'user', 'zapisano-dane-użytkownika', null, null, this.form.value);
- this.load();
- this.submitLock = false;
- } else {
- this.changeFailure = true;
- this.submitLock = false;
- }
- },error => {
- this.errorMessageId = error;
- this.submitLock = false;
- });
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement