MCPcopy
hub / github.com/imsun/gitment / likeAComment

Method likeAComment

src/gitment.js:309–325  ·  view source on GitHub ↗
(commentId)

Source from the content-addressed store, hash-verified

307 }
308
309 likeAComment(commentId) {
310 if (!this.accessToken) {
311 alert('Login to Like')
312 return Promise.reject()
313 }
314
315 const { owner, repo } = this
316 const comment = this.state.comments.find(comment => comment.id === commentId)
317
318 return http.post(`/repos/${owner}/${repo}/issues/comments/${commentId}/reactions`, {
319 content: 'heart',
320 })
321 .then(reaction => {
322 this.state.commentReactions[commentId].push(reaction)
323 comment.reactions.heart++
324 })
325 }
326
327 unlikeAComment(commentId) {
328 if (!this.accessToken) return Promise.reject()

Callers 1

renderCommentsFunction · 0.80

Calls 1

postMethod · 0.80

Tested by

no test coverage detected