Skip to content

Commit a01e140

Browse files
authored
Merge pull request #410 from codebytere/fix-subscription-ignore
fix: use thread subscription set endpoint
2 parents 811a7ba + d2c5877 commit a01e140

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/js/actions/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ describe('actions/index.js', () => {
379379

380380
// The unsubscribe endpoint call.
381381
nock('https://api.github.com/')
382-
.delete(`/notifications/threads/${id}/subscription`)
382+
.put(`/notifications/threads/${id}/subscription`)
383383
.reply(204);
384384

385385
// The mark read endpoint call.
@@ -419,7 +419,7 @@ describe('actions/index.js', () => {
419419
const message = 'Oops! Something went wrong.';
420420

421421
nock('https://api.github.com/')
422-
.delete(`/notifications/threads/${id}/subscription`)
422+
.put(`/notifications/threads/${id}/subscription`)
423423
.reply(400, { message });
424424

425425
const expectedActions = [

src/js/actions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export function unsubscribeNotification(id, hostname) {
181181

182182
dispatch({ type: UNSUBSCRIBE_NOTIFICATION.REQUEST });
183183

184-
return apiRequestAuth(unsubscribeURL, Methods.DELETE, token, {})
184+
return apiRequestAuth(unsubscribeURL, Methods.PUT, token, { ignore: true })
185185
.then((response) => {
186186
// The GitHub notifications API doesn't automatically mark things as read
187187
// like it does in the UI, so after unsubscribing we also need to hit the

0 commit comments

Comments
 (0)