Commit bdae8976 authored by Yannis Barlas's avatar Yannis Barlas

feat(submission form): make affiliations required for author input

parent 64e00343
......@@ -80,7 +80,11 @@ const AuthorInput = props => {
const creditName = `${name}.credit`
const affiliationsName = `${name}.affiliations`
const err = get(errors, authorName) || get(errors, creditName)
const err =
get(errors, authorName) ||
get(errors, creditName) ||
get(errors, affiliationsName)
const touchedThis = get(touched, name)
const autoCompleteProps = omit(props, ['label', 'name', 'value'])
......
......@@ -25,7 +25,7 @@ const validateWBExists = function(val) {
const initial = {
acknowledgements: yup.string(),
author: yup.object().shape({
affiliations: yup.string(),
affiliations: yup.string().required('Must provide author affiliations'),
credit: yup
.array()
.of(yup.string().required('Must choose credit to assign to the author'))
......@@ -46,7 +46,7 @@ const initial = {
}),
coAuthors: yup.array(
yup.object().shape({
affiliations: yup.string(),
affiliations: yup.string().required('Must provide author affiliations'),
credit: yup
.array()
.of(yup.string())
......
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