Commit eb2ea248 by Nakarin Luankla

UPDATE ปรับรายละเอียดเมื่อทำการกดรูปโปรไฟล์

parent 9e34f55b
......@@ -711,7 +711,7 @@
</div>
<div>
<p class="ti-dropdown-header-title !text-white">
{{tokenService.getUser().user?tokenService.getUser().user:''}}
{{this.employeeProfile.thFullName?this.employeeProfile.thFullName:''}}
</p>
<p class="ti-dropdown-header-content !text-white/50 " style="font-size: 12px;">
{{tokenService.getUser().iss?tokenService.getUser().iss:''}}
......
......@@ -3,6 +3,8 @@ import { Component, ElementRef } from '@angular/core';
import { NavService } from '../../services/navservice';
import { AuthService } from '../../services/auth.service';
import { TokenService } from '../../services/token.service';
import { EmployeeService } from '../../services/employee.service';
import { EmployeeModel, MyEmployeeModel } from '../../model/employee.model';
@Component({
selector: 'app-header',
......@@ -11,10 +13,26 @@ import { TokenService } from '../../services/token.service';
})
export class HeaderComponent {
employeeProfile :EmployeeModel = new MyEmployeeModel();
constructor(public navServices: NavService,
private authService: AuthService,
public tokenService:TokenService,
private employeeService: EmployeeService,
private elementRef: ElementRef) {
this.getEvaluatee();
}
getEvaluatee() {
this.employeeProfile = new MyEmployeeModel(JSON.parse(sessionStorage.getItem('employeeProfile') || '{}'));
if(this.employeeProfile?.employeeId == undefined || this.employeeProfile?.employeeId == null || this.employeeProfile?.employeeId == ''){
this.employeeService.getWorking().subscribe({
next: response => {
sessionStorage.setItem('employeeProfile', JSON.stringify(response));
this.employeeProfile = new MyEmployeeModel(response)
}
})
}
}
logOut() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment