Unverified Commit be4e7aa3 authored by Ruslan Konviser's avatar Ruslan Konviser Committed by GitHub
Browse files

Merge pull request #1131 from ever-co/fix/#1127-Profile-basic-info-save

fix: fixing save button on admin/profile-basic-info
parents 51912100 021dafe0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ export class BasicInfoComponent implements OnChanges, OnDestroy {
				.pipe(first())
				.toPromise();
			this.loading = false;
			this.basicInfoForm.markAsPristine();
			this.toasterService.pop('success', 'Successfully updated data');
		} catch (error) {
			this.loading = false;
@@ -137,6 +138,7 @@ export class BasicInfoComponent implements OnChanges, OnDestroy {
		this.validations.emailControl();
		this.validations.firstNameControl();
		this.validations.lastNameControl();
		this.validations.pictureControl();
	}

	deleteImg() {
@@ -194,6 +196,15 @@ export class BasicInfoComponent implements OnChanges, OnDestroy {
						: '';
				});
		},
		pictureControl: () => {
			this.picture.valueChanges
				.pipe(debounceTime(500), takeUntil(this.ngDestroy$))
				.subscribe((value) => {
					value !== this.admin.pictureUrl && !this.picture.invalid
						? this.picture.markAsDirty()
						: this.picture.markAsPristine();
				});
		},
	};

	private hasError(control: AbstractControl) {