()
| 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) |
no test coverage detected