Skip to content

Commit

Permalink
fix(admin-ui): custom script with location type file is not saving #1226
Browse files Browse the repository at this point in the history
  • Loading branch information
jv18creator committed Jul 20, 2023
1 parent b47025c commit 086544e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function CustomScriptForm({ item, scripts, handleSubmit, viewOnly }) {
programmingLanguage: Yup.string()
.min(3, 'This value is required')
.required('Required!'),
script: Yup.string().required('Required!'),
script: Yup.object().shape().when('location_type', { is: 'db', then: () => Yup.string().required('Required!') })
}),

onSubmit: (values) => {
Expand Down Expand Up @@ -155,6 +155,7 @@ function CustomScriptForm({ item, scripts, handleSubmit, viewOnly }) {

}
item.locationType = value;
formik.setFieldValue('location_type', value)
if (value == 'file') {
setScriptPath(true)
} else {
Expand Down

0 comments on commit 086544e

Please sign in to comment.