@@ -26,20 +26,21 @@ export default function SubmitConfUpdateTrainSchedules({
26
26
setIsWorking,
27
27
setDisplayTrainScheduleManagement,
28
28
} : SubmitConfUpdateTrainSchedulesProps ) {
29
- const { getTrainScheduleIDsToModify } = useOsrdConfSelectors ( ) ;
29
+ const { getTrainScheduleIDsToModify, getConf, getPathfindingID, getName, getDepartureTime } =
30
+ useOsrdConfSelectors ( ) ;
31
+ const confName = useSelector ( getName ) ;
32
+ const simulationConf = useSelector ( getConf ) ;
33
+ const pathfindingID = useSelector ( getPathfindingID ) ;
34
+ const departureTime = useSelector ( getDepartureTime ) ;
35
+ const trainScheduleIDsToModify = useSelector ( getTrainScheduleIDsToModify ) ;
36
+
30
37
const { updateTrainScheduleIDsToModify } = useOsrdConfActions ( ) ;
31
38
const dispatch = useDispatch ( ) ;
32
39
const { t } = useTranslation ( [ 'operationalStudies/manageTrainSchedule' ] ) ;
33
- const trainScheduleIDsToModify = useSelector ( getTrainScheduleIDsToModify ) ;
40
+
34
41
const [ patchTrainSchedules ] = osrdEditoastApi . endpoints . patchTrainSchedule . useMutation ( ) ;
35
42
36
43
async function submitConfUpdateTrainSchedules ( ) {
37
- const { getConf, getPathfindingID, getName, getDepartureTime } = useOsrdConfSelectors ( ) ;
38
- const simulationConf = useSelector ( getConf ) ;
39
- const pathfindingID = useSelector ( getPathfindingID ) ;
40
- const confName = useSelector ( getName ) ;
41
- const departureTime = useSelector ( getDepartureTime ) ;
42
-
43
44
// First train tested, and next we put the other trains
44
45
const formattedSimulationConf = formatConf ( dispatch , t , simulationConf , true ) ;
45
46
if ( ! pathfindingID ) {
0 commit comments