diff --git a/packages/frontend/src/components/upload/AuthorForm.tsx b/packages/frontend/src/components/upload/AuthorForm.tsx index c37e0a1..09c61da 100644 --- a/packages/frontend/src/components/upload/AuthorForm.tsx +++ b/packages/frontend/src/components/upload/AuthorForm.tsx @@ -12,9 +12,9 @@ const AuthorForm: React.FC = ({ jsPsychMetadata }) => { const [authors, setAuthors] = useState<(AuthorFields)[]>( jsPsychMetadata.getAuthorList().map((author: AuthorFields | string) => { if (typeof author === 'string') { - return { name: author, identifier: '' }; + return { name: author, identifier: '', oldName: author }; // need to check oldName with saving } else { - return author; + return { ...author, oldName: author["name"] }; // need to check oldName when saving } }) ); @@ -31,6 +31,10 @@ const AuthorForm: React.FC = ({ jsPsychMetadata }) => { setAuthors(newAuthors); }; + const addEmptyAuthor = () => { + setAuthors([...authors, { name: '', identifier: '' }]); + }; + return (

Authors

@@ -54,7 +58,10 @@ const AuthorForm: React.FC = ({ jsPsychMetadata }) => {
))} - + ); };