JavaScript
- 12 ответов
- 0 вопросов
14
Вклад в тег
handleSubmitForm(event) {
event.preventDefault();
let message = Object.assign({}, this.state.messages);
axios.post('/articles/add', {
title: this.state.articles.title,
content: this.state.articles.content
})
.then(function(response) {
message.success = true;
this.setState({
messages: message
});
})
.catch(function(error) {
message.error = error;
this.setState({
messages: message
});
});
}