Closed webmobiles closed 6 years ago
the right way is in handleSubmit of component:
handleSubmit(values) {
this.props.mutate({ variables: values })
.then((response) => {
if (response.data.signIn.errors.length <= 0) {
this.props.signInDispatcher(response.data.signIn.token);
this.props.history.push('/customers');
} else {
this.setState({
errors: response.data.signIn.errors,
});
}
})
.catch((err) => {
console.log('error');
console.error(err);
});
}
I have the following code, i've tried to insert ".catch" in the first line, but i'm gettint this error:
anyone can help me to understand ?