From f11d95919fd6c97d088da3ef507c5134b958e08e Mon Sep 17 00:00:00 2001 From: Julien Masson Date: Wed, 18 Mar 2020 10:47:58 +0100 Subject: [PATCH] github: support edition of diff post 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 --- lisp/forge-github.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/forge-github.el b/lisp/forge-github.el index 0330e0e3..a4b9c658 100644 --- a/lisp/forge-github.el +++ b/lisp/forge-github.el @@ -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)