Skip to content

Commit d50776c

Browse files
committed
Endpoints for deleting issue comments
1 parent 71f5b2a commit d50776c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/GitHub/Endpoints/Issues/Comments.hs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ module GitHub.Endpoints.Issues.Comments (
1313
comments',
1414
createComment,
1515
createCommentR,
16+
deleteComment,
17+
deleteCommentR,
1618
editComment,
1719
editCommentR,
1820
module GitHub.Data,
@@ -88,3 +90,19 @@ editCommentR user repo commid body =
8890
command Patch parts (encode $ EditComment body)
8991
where
9092
parts = ["repos", toPathPart user, toPathPart repo, "issues", "comments", toPathPart commid]
93+
94+
-- | Delete a comment.
95+
--
96+
-- > deleteComment (User (user, password)) user repo commentid
97+
deleteComment :: Auth -> Name Owner -> Name Repo -> Id Comment
98+
-> IO (Either Error ())
99+
deleteComment auth user repo commid =
100+
executeRequest auth $ deleteCommentR user repo commid
101+
102+
-- | Delete a comment.
103+
-- See <https://developer.github.com/v3/issues/comments/#delete-a-comment>
104+
deleteCommentR :: Name Owner -> Name Repo -> Id Comment -> Request 'RW ()
105+
deleteCommentR user repo commid =
106+
command Delete parts mempty
107+
where
108+
parts = ["repos", toPathPart user, toPathPart repo, "issues", "comments", toPathPart commid]

0 commit comments

Comments
 (0)