Skip to content

Commit

Permalink
fix: allow Manager to see Activity for all Member
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric921 committed Jan 15, 2024
1 parent 7fce7ca commit 70f6ed1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/web/app/hooks/features/useTimeDailyActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function useTimeDailyActivity(type: string) {
const todayStart = moment().startOf('day').toDate();
const todayEnd = moment().endOf('day').toDate();
const employeeId = profile.member?.employeeId ?? '';
if (profile.userProfile?.id === user?.id) {
if (profile.userProfile?.id === user?.id || user?.role?.name?.toUpperCase() == 'MANAGER') {
queryCall({
tenantId: user?.tenantId ?? '',
organizationId: user?.employee.organizationId ?? '',
Expand All @@ -48,6 +48,7 @@ export function useTimeDailyActivity(type: string) {
profile.member?.employeeId,
profile.userProfile?.id,
user?.id,
user?.role?.name,
user?.tenantId,
user?.employee.organizationId,
queryCall,
Expand Down
3 changes: 2 additions & 1 deletion apps/web/app/hooks/features/useTimeSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useTimeSlots() {
const todayStart = moment().startOf('day').toDate();
const todayEnd = moment().endOf('day').toDate();
const employeeId = profile.member?.employeeId ?? '';
if (profile.userProfile?.id === user?.id) {
if (profile.userProfile?.id === user?.id || user?.role?.name?.toUpperCase() == 'MANAGER') {
queryCall({
tenantId: user?.tenantId ?? '',
organizationId: user?.employee.organizationId ?? '',
Expand All @@ -39,6 +39,7 @@ export function useTimeSlots() {
profile.member?.employeeId,
profile.userProfile?.id,
user?.id,
user?.role?.name,
user?.tenantId,
user?.employee.organizationId,
queryCall,
Expand Down

0 comments on commit 70f6ed1

Please sign in to comment.