Skip to content

Commit

Permalink
[Mission] update isClosed field when user want to reopen a mission bu…
Browse files Browse the repository at this point in the history
…t form has errors
  • Loading branch information
claire2212 committed Oct 20, 2023
1 parent 1801aeb commit 700d0d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/features/missions/MissionForm/MissionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ export function MissionForm({ id, isAlreadyClosed, isNewMission, selectedMission

const closeMission = async () => {
await setFieldValue('isClosed', true)
validateForm().then(errors => {
validateForm().then(async errors => {
if (_.isEmpty(errors)) {
handleSubmit()
} else {
await setFieldValue('isClosed', false)
setShouldValidateOnChange(true)
}
})
Expand Down

0 comments on commit 700d0d7

Please sign in to comment.