MCPcopy
hub / github.com/gitalk/gitalk / createComment

Method createComment

src/gitalk.jsx:334–353  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

332 }
333
334 createComment () {
335 const { comment, localComments, comments } = this.state
336
337 return this.getIssue()
338 .then(issue => axiosGithub.post(issue.comments_url, {
339 body: comment
340 }, {
341 headers: {
342 Accept: 'application/vnd.github.v3.full+json',
343 Authorization: `token ${this.accessToken}`
344 }
345 }))
346 .then(res => {
347 this.setState({
348 comment: '',
349 comments: comments.concat(res.data),
350 localComments: localComments.concat(res.data)
351 })
352 })
353 }
354 logout () {
355 this.setState({ user: null })
356 window.localStorage.removeItem(GT_ACCESS_TOKEN)

Callers 1

GitalkComponentClass · 0.95

Calls 1

getIssueMethod · 0.95

Tested by

no test coverage detected