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 Apr 14, 2020
1 parent 13fcc99 commit 1e39827
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 @@ -599,10 +599,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 1e39827

Please sign in to comment.