create toggleEmailNotifications util method
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import fetchWrapper from "../fetchWrapper";
|
||||
import getXSRFToken from "../getXSRF";
|
||||
|
||||
export default async function toggleEmailNotifications(id: number) {
|
||||
const csrfToken = await getXSRFToken();
|
||||
|
||||
return fetchWrapper(
|
||||
`/api/users/${id}/email-notifications`,
|
||||
{},
|
||||
"PATCH",
|
||||
{ "X-XSRF-TOKEN": csrfToken }
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user