Merge pull request #12137 from keithjgrant/10831-inventory-source-project-validation

remove incorrect form error message in inv source
This commit is contained in:
JST
2022-05-02 17:00:15 -03:00
committed by GitHub

View File

@@ -54,14 +54,16 @@ const SCMSubForm = ({ autoPopulateProject }) => {
const handleProjectUpdate = useCallback(
(value) => {
setFieldValue('source_project', value);
setFieldValue('source_path', '');
setFieldTouched('source_path', false);
setFieldTouched('source_project', true, false);
if (sourcePathField.value) {
setFieldValue('source_path', '');
setFieldTouched('source_path', false);
}
if (value) {
fetchSourcePath(value.id);
}
},
[fetchSourcePath, setFieldValue, setFieldTouched]
[fetchSourcePath, setFieldValue, setFieldTouched, sourcePathField.value]
);
const handleCredentialUpdate = useCallback(