-
-
Save wbobeirne/e5781e3cd87145c5f3ac739b58b20fd7 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
handleSubmit = (ev: React.FormEvent) => { | |
const { name, content } = this.state; | |
ev.preventDefault(); | |
this.setState({ | |
isPosting: true, | |
error: null, | |
}); | |
api.submitPost(name, content) | |
.then(res => { | |
this.setState({ | |
isPosting: false, | |
pendingPost: res.post, | |
paymentRequest: res.paymentRequest, | |
}); | |
this.checkIfPaid(); | |
}).catch(err => { | |
this.setState({ | |
isPosting: false, | |
error: err.message, | |
}) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment