1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-15 07:09:03 +09:00
YuruToot/app/javascript/flavours/glitch/api/notification_policies.ts
Renaud Chaput af0a1a8774 [Glitch] Convert notifications policies frontend code to Typescript
Port d558dfd77d to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2024-06-18 18:22:40 +02:00

11 lines
441 B
TypeScript

import { apiRequest } from 'flavours/glitch/api';
import type { NotificationPolicyJSON } from 'flavours/glitch/api_types/notification_policies';
export const apiGetNotificationPolicy = () =>
apiRequest<NotificationPolicyJSON>('GET', '/v1/notifications/policy');
export const apiUpdateNotificationsPolicy = (
policy: Partial<NotificationPolicyJSON>,
) =>
apiRequest<NotificationPolicyJSON>('PUT', '/v1/notifications/policy', policy);