Skip to content

Commit

Permalink
fix: pre-fill name for author and point of contact
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Shi committed Sep 13, 2024
1 parent a63007e commit 9fe8de1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ export const MetadataForm = ({
useEffect(() => {
// Only on create mode, lets prefill specific fields with user data
if (mode === 'create' && user) {
setValue('citation.author.0.authorName', user.displayName)
setValue('citation.datasetContact.0.datasetContactName', user.displayName)
const displayName = `${user.lastName}, ${user.firstName}`
setValue('citation.author.0.authorName', displayName)
setValue('citation.datasetContact.0.datasetContactName', displayName)
setValue('citation.datasetContact.0.datasetContactEmail', user.email, {
shouldValidate: true
})
Expand Down

0 comments on commit 9fe8de1

Please sign in to comment.