Skip to content

Commit

Permalink
github: support edition of diff post
Browse files Browse the repository at this point in the history
When editing a diff post, the URL must be the following format:
/repos/:owner/:repo/pulls/comments/:comment_id

Source:
https://developer.github.com/v3/pulls/comments/#edit-a-comment

Signed-off-by: Julien Masson <[email protected]>
  • Loading branch information
JulienMasson committed Mar 18, 2021
1 parent 2df8d36 commit 0946242
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lisp/forge-github.el
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,12 @@

(cl-defmethod forge--submit-edit-post ((_ forge-github-repository) post)
(forge--ghub-patch post
(cl-typecase post
(forge-pullreq "/repos/:owner/:repo/pulls/:number")
(forge-issue "/repos/:owner/:repo/issues/:number")
(forge-post "/repos/:owner/:repo/issues/comments/:number"))
(if (and (forge-pullreq-post-p post) (oref post diff-p))
"/repos/:owner/:repo/pulls/comments/:number"
(cl-typecase post
(forge-pullreq "/repos/:owner/:repo/pulls/:number")
(forge-issue "/repos/:owner/:repo/issues/:number")
(forge-post "/repos/:owner/:repo/issues/comments/:number")))
(if (cl-typep post 'forge-topic)
(let-alist (forge--topic-parse-buffer)
`((title . , .title)
Expand Down

0 comments on commit 0946242

Please sign in to comment.