Commit 59c4805a authored by nickstiffler's avatar nickstiffler Committed by Yannis Barlas

fix(assign reviewers): trim whitespace in form

parent 3e247782
......@@ -14,10 +14,17 @@ const initialValues = {
const validations = yup.object().shape({
email: yup
.string()
.trim()
.required('Email is required')
.email('Invalid email address'),
givenNames: yup.string().required('Given names are required'),
surname: yup.string().required('Surname is required'),
givenNames: yup
.string()
.trim()
.required('Given names are required'),
surname: yup
.string()
.trim()
.required('Surname is required'),
})
const AddReviewerForm = props => {
......@@ -27,9 +34,9 @@ const AddReviewerForm = props => {
const { email, givenNames, surname } = formValues
const input = {
email,
givenNames,
surname,
email: email.trim(),
givenNames: givenNames.trim(),
surname: surname.trim(),
}
addExternalReviewer(input).then(() => formikBag.resetForm())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment