[feat] - add filter transaction and display payer payee information

This commit is contained in:
2023-11-03 14:01:21 +07:00
parent 51a0e04c94
commit a1e10c2417
11 changed files with 189 additions and 93 deletions

View File

@@ -46,13 +46,22 @@ export class LoginComponent implements OnInit {
try {
// const result = await lastValueFrom(this.authService.login(this.dataForm));
let cathayResult: any = await lastValueFrom(this.cathayAuthService.login(this.cathayForm));
let isAdmin = cathayResult.token.userName == ROLE_ADMIN ? true : false
cathayResult = {
...cathayResult,
isAdmin: cathayResult.token.userName == ROLE_ADMIN ? true : false
isAdmin: isAdmin
}
this.appService.setToken(cathayResult.token.token)
this.appService.setAuth(cathayResult);
return this.router.navigate(['/pages']);
if(isAdmin){
return this.router.navigate(['/pages']);
}
if(!isAdmin){
return this.router.navigate(['/pages/report/transactions']);
}
} catch (err) {
return this.appService.message(EAction.ERROR, EText.NO_DATA);
}