diff --git a/src/utils/users/toggleWebNotifications.ts b/src/utils/users/toggleWebNotifications.ts new file mode 100644 index 0000000..a068c0b --- /dev/null +++ b/src/utils/users/toggleWebNotifications.ts @@ -0,0 +1,13 @@ +import fetchWrapper from "../fetchWrapper"; +import getXSRFToken from "../getXSRF"; + +export default async function toggleWebNotifications(id: number) { + const csrfToken = await getXSRFToken(); + + return fetchWrapper( + `/api/users/${id}/web-notifications`, + {}, + "PATCH", + { "X-XSRF-TOKEN": csrfToken } + ); +} \ No newline at end of file