Skip to content

Commit

Permalink
fix(env-variable): fix environment variable creation without mount_fi…
Browse files Browse the repository at this point in the history
…le (#497)
  • Loading branch information
bdebon authored Feb 15, 2023
1 parent 0aa5846 commit dd4b4a4
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ export function CrudEnvironmentVariableModalFeature(props: CrudEnvironmentVariab
mode: 'onChange',
})

const onSubmit = methods.handleSubmit(
(data) =>
props.serviceType &&
handleSubmitForEnvSecretCreation(data, setLoading, props, dispatch, setClosing, props.serviceType)
)
const onSubmit = methods.handleSubmit((data) => {
if (props.serviceType) {
const cloneData = { ...data }
if (!isFile) {
delete cloneData.mountPath
}
handleSubmitForEnvSecretCreation(cloneData, setLoading, props, dispatch, setClosing, props.serviceType)
}
})

useEffect(() => {
enableAlertClickOutside(methods.formState.isDirty)
Expand Down

0 comments on commit dd4b4a4

Please sign in to comment.