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

refactor(author-list): refactor to work with api changes

parent c8a66d90
No related branches found
No related tags found
1 merge request!5Refactor component invite
......@@ -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*"
......
......@@ -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) =>
......
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