В
Size: a a a
Y
Y
createQuestion(question) {
return axios.post(`${QUESTION_API}/create`, question);
},
createQuestion = (e) => {вот как я делал на реакте
e.preventDefault();
let question = {title: this.state.title}
questionApi.createQuestion(question)
.then(res => {
return window.location.replace("/questions")
}).catch(err => {
if (err.response.data && err.response.data.validationErrors) {
const message = err.response.data.validationErrors.title
this.setState({errorMessage: message})
}
})
}
Y
Y
F
Y
DE
Y
F
DE
Y
DE