Skip to content

Commit e6db90e

Browse files
authored
Mark as read after unsubscribe (#29)
1 parent 403f654 commit e6db90e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/api/notifications.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ export function markNotificationAsRead(id: Thread['id'], accessToken: NonNullabl
170170
})
171171
}
172172

173-
export function unsubscribeNotification(id: Thread['id'], accessToken: NonNullable<AppStorageContext['accessToken']>) {
174-
return redaxios.delete(`https://api.github.com/notifications/threads/${id}/subscription`, {
173+
export async function unsubscribeNotification(id: Thread['id'], accessToken: NonNullable<AppStorageContext['accessToken']>) {
174+
await redaxios.put(`https://api.github.com/notifications/threads/${id}/subscription`, { ignored: true }, {
175175
headers: createBaseGithubApiHeaders(accessToken),
176176
})
177+
178+
await markNotificationAsRead(id, accessToken)
177179
}

0 commit comments

Comments
 (0)