Skip to content

Commit 61db9b7

Browse files
dlaxmergify-bot
authored andcommitted
Bind "delete thread subscription" notification endpoint
This is used to "mute" a thread of notifications.
1 parent 4c922eb commit 61db9b7

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
@@ -31,6 +31,7 @@ module GitHub (
3131
getNotificationsR,
3232
markNotificationAsReadR,
3333
markAllNotificationsAsReadR,
34+
deleteThreadSubscriptionR,
3435

3536
-- ** Starring
3637
-- | 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
@@ -34,3 +34,15 @@ markNotificationAsReadR nid = Command
3434
markAllNotificationsAsReadR :: GenRequest 'MtUnit 'RW ()
3535
markAllNotificationsAsReadR =
3636
Command Put ["notifications"] $ encode emptyObject
37+
38+
deleteThreadSubscription :: Auth -> Id Notification -> IO (Either Error ())
39+
deleteThreadSubscription auth nid =
40+
executeRequest auth $ deleteThreadSubscriptionR nid
41+
42+
-- | Delete a thread subscription.
43+
-- See <https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription>
44+
deleteThreadSubscriptionR :: Id Notification -> GenRequest 'MtUnit 'RW ()
45+
deleteThreadSubscriptionR nid = Command
46+
Delete
47+
["notifications", "threads", toPathPart nid, "subscription"]
48+
mempty

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy