diff --git a/packages/webapp/src/containers/Task/saga.js b/packages/webapp/src/containers/Task/saga.js index af8e1a162b..38221caded 100644 --- a/packages/webapp/src/containers/Task/saga.js +++ b/packages/webapp/src/containers/Task/saga.js @@ -85,6 +85,7 @@ import { import { setFormData } from '../hooks/useHookFormPersist/hookFormPersistSlice'; import { formatSoilAmendmentProductToDBStructure, getSubtaskName } from '../../util/task'; import { formatAnimalIdsForReqBody, getEndpoint, getMovementTaskBody } from './sagaUtils'; +import { api } from '../../store/api/apiSlice'; const taskTypeEndpoint = [ 'cleaning_task', @@ -797,6 +798,10 @@ export function* completeTaskSaga({ payload: { task_id, data, returnPath } }) { message: i18n.t('message:TASK.COMPLETE.SUCCESS'), pathname: returnPath ?? '/tasks', }); + + if (task_translation_key === 'MOVEMENT_TASK') { + yield put(api.util.invalidateTags(['Animals', 'AnimalBatches'])); + } } } catch (e) { console.log(e);