Skip to content

Commit

Permalink
use form validator
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong committed Oct 4, 2023
1 parent acaa86f commit 69e5722
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/DataSubmissionForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import NihAnvilUse from '../components/data_submission/NihAnvilUse';
// If any validation changes, it needs to be manually updated in both DataRegistrationV1Validation
// and JsonSchemaUtils
import validateSchema from '../assets/schemas/DataRegistrationV1Validation';
import {uniqueValidator} from '../components/forms/formValidation';
import { set } from 'lodash';
import UsgOmbText from '../components/UsgOmbText';

Expand Down Expand Up @@ -108,7 +109,7 @@ export const DataSubmissionForm = (props) => {

// check against json schema to see if there are uncaught validation issues
let [valid, validation] = validateForm(validateSchema, registration);
if (studyNames.includes(registration.studyName)) {
if (!uniqueValidator.isValid(registration.studyName, studyNames)) {
validation.studyName = {
failed: ['unique'],
valid: false
Expand Down

0 comments on commit 69e5722

Please sign in to comment.