From 543b9398acd357d18c85e4cc520347feb90d375b Mon Sep 17 00:00:00 2001 From: George Nash Date: Mon, 10 Jun 2024 14:16:27 +0100 Subject: [PATCH] generic error message displayed on update user page for 400 bad requests --- ui/src/app/error/error-alert.component.ts | 1 + ui/src/app/user/user-update.component.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/src/app/error/error-alert.component.ts b/ui/src/app/error/error-alert.component.ts index 43c551a35..8dc029135 100644 --- a/ui/src/app/error/error-alert.component.ts +++ b/ui/src/app/error/error-alert.component.ts @@ -19,6 +19,7 @@ export class ErrorAlertComponent implements OnInit { ngOnInit(): void { this.sub = this.errorService.on().subscribe((err: AppError) => { console.log(err) + console.log('error message is ', err.message) const alert: ErrorAlert = { type: 'danger', diff --git a/ui/src/app/user/user-update.component.ts b/ui/src/app/user/user-update.component.ts index e326bedf7..fe174e9e5 100644 --- a/ui/src/app/user/user-update.component.ts +++ b/ui/src/app/user/user-update.component.ts @@ -106,6 +106,12 @@ export class UserUpdateComponent { this.showIsAdminCheckbox = false } }) + + this.editForm.get('firstName')?.valueChanges.subscribe((val) => (this.isSaving = false)) + this.editForm.get('lastName')?.valueChanges.subscribe((val) => (this.isSaving = false)) + this.editForm.get('salesforceId')?.valueChanges.subscribe((val) => (this.isSaving = false)) + this.editForm.get('mainContact')?.valueChanges.subscribe((val) => (this.isSaving = false)) + this.editForm.get('assertionServiceEnabled')?.valueChanges.subscribe((val) => (this.isSaving = false)) } updateForm(user: IUser) { @@ -308,28 +314,24 @@ export class UserUpdateComponent { protected subscribeToSaveResponse(result: Observable) { result.subscribe({ next: () => this.onSaveSuccess(), - error: () => this.onSaveError(), }) } protected subscribeToUpdateResponse(result: Observable) { result.subscribe({ next: () => this.onUpdateSuccess(), - error: () => this.onSaveError(), }) } protected subscribeToSaveResponseWithOwnershipChange(result: Observable) { result.subscribe({ next: () => this.onSaveSuccessOwnershipChange(), - error: () => this.onSaveError(), }) } protected subscribeToUpdateResponseWithOwnershipChange(result: Observable) { result.subscribe({ next: () => this.onUpdateSuccessOwnershipChange(), - error: () => this.onSaveError(), }) }