diff --git a/packages/apps/hr/src/components/molecules/TimesheetDetailsButtons/TimesheetDetailsButtons.tsx b/packages/apps/hr/src/components/molecules/TimesheetDetailsButtons/TimesheetDetailsButtons.tsx index 854e4a1081..c703798905 100644 --- a/packages/apps/hr/src/components/molecules/TimesheetDetailsButtons/TimesheetDetailsButtons.tsx +++ b/packages/apps/hr/src/components/molecules/TimesheetDetailsButtons/TimesheetDetailsButtons.tsx @@ -77,7 +77,7 @@ const TimesheetDetailsButtons = ({ timesheetId: timesheet.id, version: timesheet.version, toStatus: 'confirm', - userId: user.id, + user: user, }), ) } @@ -116,7 +116,7 @@ const TimesheetDetailsButtons = ({ timesheetId: timesheet.id, version: timesheet.version, toStatus: 'validate', - userId: user.id, + user: user, }), ) } diff --git a/packages/apps/hr/src/components/templates/TimesheetRefusalPopup/TimesheetRefusalPopup.tsx b/packages/apps/hr/src/components/templates/TimesheetRefusalPopup/TimesheetRefusalPopup.tsx index 6d6429219a..0a5387a569 100644 --- a/packages/apps/hr/src/components/templates/TimesheetRefusalPopup/TimesheetRefusalPopup.tsx +++ b/packages/apps/hr/src/components/templates/TimesheetRefusalPopup/TimesheetRefusalPopup.tsx @@ -44,11 +44,11 @@ const TimesheetRefusalPopup = ({ version: timesheet.version, toStatus: 'refuse', groundForRefusal: refusalMessage, - userId: user.id, + user: user, }), ); }, - [dispatch, timesheet, user.id], + [dispatch, timesheet, user], ); return ( diff --git a/packages/apps/hr/src/features/timesheetSlice.js b/packages/apps/hr/src/features/timesheetSlice.js index 90567d9e8c..790d9eb00e 100644 --- a/packages/apps/hr/src/features/timesheetSlice.js +++ b/packages/apps/hr/src/features/timesheetSlice.js @@ -126,7 +126,10 @@ export const updateTimesheetStatus = createAsyncThunk( dispatch(fetchTimesheetById({timesheetId: data.timesheetId})); }) .then(() => { - dispatch(fetchTimesheet({userId: data.userId})); + dispatch(fetchTimesheet({userId: data.user.id})); + }) + .then(() => { + dispatch(fetchTimesheetToValidate({user: data.user})); }); }, ); diff --git a/packages/apps/hr/src/screens/timesheet/TimesheetListScreen.js b/packages/apps/hr/src/screens/timesheet/TimesheetListScreen.js index 63527b742c..2243192ea9 100644 --- a/packages/apps/hr/src/screens/timesheet/TimesheetListScreen.js +++ b/packages/apps/hr/src/screens/timesheet/TimesheetListScreen.js @@ -58,7 +58,7 @@ const TimesheetListScreen = ({navigation}) => { timesheetId: timesheet.id, version: timesheet.version, toStatus: toStatus, - userId: user.id, + user: user, }), ), [dispatch, user],