Fix: Error messages were not properly captured in the frontend.
Feature: F5,6,7 to change between Receipt, Payment and Journal voucher.
This commit is contained in:
1 parent
11d43f08af
commit
e35db8144b
16 files changed
+76
-34
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { AfterViewInit, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatCard, MatCardActions, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
|
||||
@@ -38,6 +38,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
||||
private router = inject(Router);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private cs = inject(CookieService);
|
||||
private cd = inject(ChangeDetectorRef);
|
||||
|
||||
@ViewChild('nameElement', { static: true }) nameElement!: ElementRef<HTMLInputElement>;
|
||||
form: FormGroup<{
|
||||
@@ -87,6 +88,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
||||
if (error.status === 401 && error.error.detail === 'Client is not registered') {
|
||||
this.showOtp = true;
|
||||
this.clientId = this.cs.getCookie('client_id');
|
||||
this.cd.detectChanges();
|
||||
}
|
||||
this.snackBar.open(error.error.details, 'Danger');
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user