From 3488034b86c513d6999c6f701e93722bdce8727e Mon Sep 17 00:00:00 2001 From: vhu-axelor <146069039+vhu-axelor@users.noreply.github.com> Date: Fri, 9 Feb 2024 12:49:40 +0100 Subject: [PATCH] fix: timesheet not refresh when modify (#398) * RM#75175 --- packages/apps/hr/src/features/timesheetLineSlice.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/apps/hr/src/features/timesheetLineSlice.js b/packages/apps/hr/src/features/timesheetLineSlice.js index ab086aa39f..1aa3651bbd 100644 --- a/packages/apps/hr/src/features/timesheetLineSlice.js +++ b/packages/apps/hr/src/features/timesheetLineSlice.js @@ -27,6 +27,7 @@ import { fetchTimesheetLine as _fetchTimesheetLine, updateTimesheetLine as _updateTimesheetLine, } from '../api/timesheet-line-api'; +import {fetchTimesheetById} from './timesheetSlice'; export const fetchTimesheetLine = createAsyncThunk( 'timesheetLine/fetchTimesheetLine', @@ -52,7 +53,7 @@ export const createTimesheetLine = createAsyncThunk( responseOptions: {isArrayResponse: false, showToast: true}, }).then(() => dispatch( - fetchTimesheetLine({timesheetId: data.timesheetLine.timesheetId}), + fetchTimesheetById({timesheetId: data.timesheetLine.timesheetId}), ), ); }, @@ -68,7 +69,7 @@ export const updateTimesheetLine = createAsyncThunk( getState, responseOptions: {isArrayResponse: false, showToast: true}, }).then(() => - dispatch(fetchTimesheetLine({timesheetId: data.timesheetId})), + dispatch(fetchTimesheetById({timesheetId: data.timesheetId})), ); }, ); @@ -83,7 +84,7 @@ export const deleteTimesheetLine = createAsyncThunk( getState, responseOptions: {isArrayResponse: false, showToast: true}, }).then(() => { - dispatch(fetchTimesheetLine({timesheetId: data.timesheetId})); + dispatch(fetchTimesheetById({timesheetId: data.timesheetId})); }); }, );