Move instances of Client.resendVerification() in components to an action (#5169)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-01-24 12:51:43 +01:00
коммит произвёл George Goldberg
родитель b87cd4e276
Коммит 479bd1a2b3
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@@ -600,3 +600,19 @@ export function resetPassword(code, password, success, error) {
}
);
}
export function resendVerification(email, success, error) {
Client.resendVerification(
email,
() => {
if (success) {
success();
}
},
(err) => {
if (error) {
error(err);
}
}
);
}

Просмотреть файл

@@ -2,11 +2,12 @@
// See License.txt for license information.
import {FormattedMessage} from 'react-intl';
import Client from 'client/web_client.jsx';
import React from 'react';
import {Link} from 'react-router/es6';
import {resendVerification} from 'actions/user_actions.jsx';
export default class ShouldVerifyEmail extends React.Component {
constructor(props) {
super(props);
@@ -22,7 +23,7 @@ export default class ShouldVerifyEmail extends React.Component {
this.setState({resendStatus: 'sending'});
Client.resendVerification(
resendVerification(
email,
() => {
this.setState({resendStatus: 'success'});