Skip to content

Commit

Permalink
generic error message displayed on update user page for 400 bad requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bobcaprice committed Jun 10, 2024
1 parent c6e7656 commit 543b939
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions ui/src/app/error/error-alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 6 additions & 4 deletions ui/src/app/user/user-update.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -308,28 +314,24 @@ export class UserUpdateComponent {
protected subscribeToSaveResponse(result: Observable<IUser>) {
result.subscribe({
next: () => this.onSaveSuccess(),
error: () => this.onSaveError(),
})
}

protected subscribeToUpdateResponse(result: Observable<IUser>) {
result.subscribe({
next: () => this.onUpdateSuccess(),
error: () => this.onSaveError(),
})
}

protected subscribeToSaveResponseWithOwnershipChange(result: Observable<IUser>) {
result.subscribe({
next: () => this.onSaveSuccessOwnershipChange(),
error: () => this.onSaveError(),
})
}

protected subscribeToUpdateResponseWithOwnershipChange(result: Observable<IUser>) {
result.subscribe({
next: () => this.onUpdateSuccessOwnershipChange(),
error: () => this.onSaveError(),
})
}

Expand Down

0 comments on commit 543b939

Please sign in to comment.