File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
src/app/admin/users/new-kombit-user-page Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1313 < li *ngFor ="let error of errorMessages ">
1414 {{ error | translate }}
1515 </ li >
16+ < li *ngIf ="errorMessage ">
17+ {{errorMessage | translate}}
18+ </ li >
1619 </ ul >
1720 </ div >
1821 < div class ="form-group mt-3 ">
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class NewUserComponent implements OnInit {
3232 public filteredOrganisations : ReplaySubject <
3333 Organisation [ ]
3434 > = new ReplaySubject < Organisation [ ] > ( 1 ) ;
35+ public errorMessage : string ;
3536 private onDestroy = new Subject < void > ( ) ;
3637
3738 constructor (
@@ -146,8 +147,12 @@ export class NewUserComponent implements OnInit {
146147 }
147148
148149 handleError ( error : HttpErrorResponse ) {
149- const errors = this . errorMessageService . handleErrorMessageWithFields ( error ) ;
150- this . errorFields = errors . errorFields ;
151- this . errorMessages = errors . errorMessages ;
150+ if ( typeof error . error === 'string' && typeof error . message === 'string' ) {
151+ this . errorMessage = error . message ;
152+ } else {
153+ const errors = this . errorMessageService . handleErrorMessageWithFields ( error ) ;
154+ this . errorFields = errors . errorFields ;
155+ this . errorMessages = errors . errorMessages ;
156+ }
152157 }
153158}
You can’t perform that action at this time.
0 commit comments