Skip to content

Commit 437c6ca

Browse files
authored
Merge pull request #294 from dahlia/delete-comment
Endpoints for deleting issue comments
2 parents 927d6fd + 316c669 commit 437c6ca

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/GitHub.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ module GitHub (
106106
-- ** Comments
107107
-- | See <https://developer.github.com/v3/issues/comments/>
108108
--
109-
-- Missing endpoints:
110-
--
111-
-- * Delete comment
112109
commentR,
113110
commentsR,
114111
createCommentR,
112+
deleteCommentR,
115113
editCommentR,
116114

117115
-- ** Events

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)