Skip to content

Commit fcb7253

Browse files
committed
Fix for issue with the wrong error message being displayed while updating a KOMBIT user
1 parent d29c71e commit fcb7253

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/admin/users/new-kombit-user-page/new-user.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h1>
88
{{ 'NEW_USER.FIRST_LOGIN' | translate }}
99
</h1>
1010
<form (ngSubmit)="onSubmit()" #newUserForm="ngForm">
11-
<div *ngIf="errorMessages" class="error-messages p-3">
11+
<div *ngIf="errorMessages || errorMessage" class="error-messages p-3">
1212
<ul class="mb-0">
1313
<li *ngFor="let error of errorMessages">
1414
{{ error | translate }}

src/app/admin/users/new-kombit-user-page/new-user.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ export class NewUserComponent implements OnInit {
147147
}
148148

149149
handleError(error: HttpErrorResponse) {
150-
if (typeof error.error === 'string' && typeof error.message === 'string') {
151-
this.errorMessage = error.message;
150+
if (typeof error.error?.error === 'string' && typeof error.error?.message === 'string') {
151+
this.errorMessage = error.error?.message;
152152
} else {
153153
const errors = this.errorMessageService.handleErrorMessageWithFields(error);
154154
this.errorFields = errors.errorFields;
155155
this.errorMessages = errors.errorMessages;
156-
}
156+
}
157157
}
158158
}

0 commit comments

Comments
 (0)