Last active
November 14, 2018 18:01
-
-
Save hpjaj/4ccfe11ad04722f070762dbe1731409a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/javascript/components/NewPost.js | |
handleSubmit = event => { | |
event.preventDefault(); | |
const post = { | |
title: this.state.title, | |
body: this.state.body | |
} | |
axios | |
.post('/api/posts', post) | |
.then(response => { | |
console.log(response); | |
console.log(response.data); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment