@@ -13,11 +13,9 @@ import { StyledDialog } from 'components/Styles/StyledComponents'
1313import { allDays , DaysOfWeek , TimeAndDay } from 'models/AutoScheduleFrequency'
1414import { MissionDefinition } from 'models/MissionDefinition'
1515import { MissionDefinitionUpdateForm } from 'models/MissionDefinitionUpdateForm'
16- import { ChangeEvent , useContext , useState } from 'react'
17- import { useNavigate } from 'react-router-dom'
16+ import { ChangeEvent , useState } from 'react'
1817import styled from 'styled-components'
1918import { useBackendApi } from 'api/UseBackendApi'
20- import { InstallationContext } from 'components/Contexts/InstallationContext'
2119
2220const StyledSummary = styled . div `
2321 padding: 16px 8px 0px 8px;
@@ -57,8 +55,6 @@ const StyledTimeChips = styled.div`
5755const useMissionUpdater = ( ) => {
5856 const { TranslateText } = useLanguageContext ( )
5957 const { setAlert, setListAlert } = useAlertContext ( )
60- const { installation } = useContext ( InstallationContext )
61- const navigate = useNavigate ( )
6258 const backendApi = useBackendApi ( )
6359
6460 const updateMission = (
@@ -70,16 +66,12 @@ const useMissionUpdater = () => {
7066 comment : mission . comment ,
7167 schedulingTimesCETperWeek : mission . autoScheduleFrequency ?. schedulingTimesCETperWeek ,
7268 name : mission . name ,
73- isDeprecated : false ,
7469 }
7570 const form : MissionDefinitionUpdateForm = { ...defaultForm , ...partialForm }
7671
7772 backendApi
7873 . updateMissionDefinition ( mission . id , form )
79- . then ( ( missionDefinition ) => {
80- onSuccess ( )
81- if ( missionDefinition . isDeprecated ) navigate ( `/${ installation . installationCode } ` )
82- } )
74+ . then ( onSuccess )
8375 . catch ( ( ) => {
8476 setAlert (
8577 AlertType . RequestFail ,
0 commit comments