diff --git a/packages/components-faraday/src/components/AuthorList/AuthorEditor.js b/packages/components-faraday/src/components/AuthorList/AuthorEditor.js index 53f69eecc5e7fc0e87c570a54b93930133eb768f..98b088a7c5d64bbb0c8a21762a2db9d252808d85 100644 --- a/packages/components-faraday/src/components/AuthorList/AuthorEditor.js +++ b/packages/components-faraday/src/components/AuthorList/AuthorEditor.js @@ -14,14 +14,7 @@ import { authorSuccess, authorFailure, } from '../../redux/authors' -import { ValidatedTextField } from './FormItems' - -const emailRegex = new RegExp( - /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i, //eslint-disable-line -) - -const emailValidator = value => - emailRegex.test(value) ? undefined : 'Invalid email' +import { ValidatedTextField, Label } from './FormItems' const renderCheckbox = ({ input }) => ( <Checkbox checked={input.value} type="checkbox" {...input} /> @@ -79,12 +72,7 @@ const AuthorEdit = ({ </Row> <Row> - <ValidatedTextField - isRequired - label="Email*" - name="edit.email" - validators={[emailValidator]} - /> + <Label label="Email" value={email} /> <ValidatedTextField isRequired label="Affiliation*" diff --git a/packages/components-faraday/src/redux/authors.js b/packages/components-faraday/src/redux/authors.js index e7767063fce3ad2c52194935e28b5875a5d60d95..a348f22be32e767f5f356bbae543fc887082dd5d 100644 --- a/packages/components-faraday/src/redux/authors.js +++ b/packages/components-faraday/src/redux/authors.js @@ -51,7 +51,7 @@ export const getAuthorsTeam = collectionId => ) export const updateAuthorsTeam = (teamId, body) => - update(`/teams/${teamId}s`, body) + update(`/teams/${teamId}`, body) // selectors export const getFragmentAuthors = (state, fragmentId) =>