Skip to content
Snippets Groups Projects
Commit 0c7475cc authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix(author-list): add correct initial values for author adder

parent 44aaef69
No related branches found
No related tags found
No related merge requests found
...@@ -81,16 +81,23 @@ export default compose( ...@@ -81,16 +81,23 @@ export default compose(
authorFailure, authorFailure,
}, },
), ),
withProps(({ currentUser: { admin, username, email }, authors }) => { withProps(
if (!admin && authors.length === 0) { ({
return { currentUser: { admin, affiliation, firstName, lastName, email },
initialValues: { authors,
email, }) => {
firstName: username, if (!admin && authors.length === 0) {
}, return {
initialValues: {
affiliation,
email,
firstName,
lastName,
},
}
} }
} },
}), ),
reduxForm({ reduxForm({
form: 'author', form: 'author',
enableReinitialize: true, enableReinitialize: true,
......
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