From d2c58774a360d2f2a5b528c1219c9b5158f0b51b Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 22 May 2020 11:41:28 -0700 Subject: [PATCH] fix: use thread subscription set endpoint --- src/js/actions/index.test.ts | 4 ++-- src/js/actions/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/actions/index.test.ts b/src/js/actions/index.test.ts index d15e31661..b9b560755 100644 --- a/src/js/actions/index.test.ts +++ b/src/js/actions/index.test.ts @@ -379,7 +379,7 @@ describe('actions/index.js', () => { // The unsubscribe endpoint call. nock('https://api.github.com/') - .delete(`/notifications/threads/${id}/subscription`) + .put(`/notifications/threads/${id}/subscription`) .reply(204); // The mark read endpoint call. @@ -419,7 +419,7 @@ describe('actions/index.js', () => { const message = 'Oops! Something went wrong.'; nock('https://api.github.com/') - .delete(`/notifications/threads/${id}/subscription`) + .put(`/notifications/threads/${id}/subscription`) .reply(400, { message }); const expectedActions = [ diff --git a/src/js/actions/index.ts b/src/js/actions/index.ts index aabee3c01..e64ac5f4b 100644 --- a/src/js/actions/index.ts +++ b/src/js/actions/index.ts @@ -181,7 +181,7 @@ export function unsubscribeNotification(id, hostname) { dispatch({ type: UNSUBSCRIBE_NOTIFICATION.REQUEST }); - return apiRequestAuth(unsubscribeURL, Methods.DELETE, token, {}) + return apiRequestAuth(unsubscribeURL, Methods.PUT, token, { ignore: true }) .then((response) => { // The GitHub notifications API doesn't automatically mark things as read // like it does in the UI, so after unsubscribing we also need to hit the