Skip to content

Commit 519d8d6

Browse files
committed
Bind "delete thread subscription" notification endpoint
This is used to "mute" a thread of notifications.
1 parent 6ab81aa commit 519d8d6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/GitHub.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module GitHub (
2525
getNotificationsR,
2626
markNotificationAsReadR,
2727
markAllNotificationsAsReadR,
28+
deleteThreadSubscriptionR,
2829

2930
-- ** Starring
3031
-- | See <https://developer.github.com/v3/activity/starring/>

src/GitHub/Endpoints/Activity/Notifications.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,15 @@ markNotificationsAsRead auth =
4343
markAllNotificationsAsReadR :: GenRequest 'MtUnit 'RW ()
4444
markAllNotificationsAsReadR =
4545
Command Put ["notifications"] $ encode emptyObject
46+
47+
deleteThreadSubscription :: Auth -> Id Notification -> IO (Either Error ())
48+
deleteThreadSubscription auth nid =
49+
executeRequest auth $ deleteThreadSubscriptionR nid
50+
51+
-- | Delete a thread subscription.
52+
-- See <https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription>
53+
deleteThreadSubscriptionR :: Id Notification -> GenRequest 'MtUnit 'RW ()
54+
deleteThreadSubscriptionR nid = Command
55+
Delete
56+
["notifications", "threads", toPathPart nid, "subscription"]
57+
mempty

0 commit comments

Comments
 (0)