Revize aab2b127
Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)
webapp/src/app/dashboard/employer-dashboard/employer-dashboard.component.ts | ||
---|---|---|
36 | 36 |
ngOnInit() { |
37 | 37 |
this.selectedMonth = this.dateToolsService.toStartOfMonth(new Date()); |
38 | 38 |
|
39 |
this.loadProfile(); |
|
40 |
this.loadAuthorizationRequests(); |
|
41 |
this.loadVacationRequests(); |
|
39 |
this.userService.getLoggedUserProfile() |
|
40 |
.subscribe((data: UserProfile) => { |
|
41 |
this.profile = data; |
|
42 |
if (this.isEmployer()) { |
|
43 |
this.loadAuthorizationRequests(); |
|
44 |
this.loadVacationRequests(); |
|
45 |
} |
|
46 |
}); |
|
47 |
|
|
42 | 48 |
this.loadMonthVacation(this.selectedMonth); |
43 | 49 |
this.loadOncomingVacation(); |
44 | 50 |
} |
... | ... | |
67 | 73 |
.subscribe(() => { |
68 | 74 |
this.loadOncomingVacation(); |
69 | 75 |
this.loadMonthVacation(this.selectedMonth); |
76 |
this.loadProfile(); |
|
70 | 77 |
}); |
71 | 78 |
} |
72 | 79 |
|
... | ... | |
90 | 97 |
).subscribe(() => { |
91 | 98 |
this.loadMonthVacation(this.selectedMonth); |
92 | 99 |
this.loadOncomingVacation(); |
100 |
this.loadProfile(); |
|
93 | 101 |
}); |
94 | 102 |
} |
95 | 103 |
}); |
... | ... | |
107 | 115 |
return false; |
108 | 116 |
} |
109 | 117 |
} |
118 |
|
|
110 | 119 |
private loadProfile() { |
111 | 120 |
this.userService.getLoggedUserProfile() |
112 | 121 |
.subscribe((data: UserProfile) => this.profile = data); |
Také k dispozici: Unified diff
Profile reload on add/remove vacation + removed uncecessary API calls when employee is logged in