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

Method like

src/gitment.js:279–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277 }
278
279 like() {
280 if (!this.accessToken) {
281 alert('Login to Like')
282 return Promise.reject()
283 }
284
285 const { owner, repo } = this
286
287 return http.post(`/repos/${owner}/${repo}/issues/${this.state.meta.number}/reactions`, {
288 content: 'heart',
289 })
290 .then(reaction => {
291 this.state.reactions.push(reaction)
292 this.state.meta.reactions.heart++
293 })
294 }
295
296 unlike() {
297 if (!this.accessToken) return Promise.reject()

Callers 1

renderHeaderFunction · 0.80

Calls 1

postMethod · 0.80

Tested by

no test coverage detected