diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js index a420f98a2..c6dca3a65 100644 --- a/src/components/auth/Invite.js +++ b/src/components/auth/Invite.js @@ -45,16 +45,16 @@ export default class Invite extends Component { form = new Form({ fields: { invite: [...Array(3).fill({ - name: { - label: this.context.intl.formatMessage(messages.nameLabel), - // value: '', - placeholder: this.context.intl.formatMessage(messages.nameLabel), - }, - email: { - label: this.context.intl.formatMessage(messages.emailLabel), - // value: '', - validators: [email], - placeholder: this.context.intl.formatMessage(messages.emailLabel), + fields: { + name: { + label: this.context.intl.formatMessage(messages.nameLabel), + placeholder: this.context.intl.formatMessage(messages.nameLabel), + }, + email: { + label: this.context.intl.formatMessage(messages.emailLabel), + placeholder: this.context.intl.formatMessage(messages.emailLabel), + validators: [email], + }, }, })], }, @@ -74,6 +74,10 @@ export default class Invite extends Component { const { form } = this; const { intl } = this.context; + const atLeastOneEmailAddress = form.$('invite') + .map(invite => invite.$('email').value) + .some(emailValue => emailValue.trim() !== ''); + return (
this.submit(e)}> @@ -96,6 +100,7 @@ export default class Invite extends Component {