tootlab-mastodon/app/javascript/flavours/glitch/api/notification_policies.ts
Renaud Chaput 3a20290915 [Glitch] Change apiRequest to accept both params and data
Port 547e97945df0abc68dc473ed60d2faeb2feb2b06
2024-06-25 18:03:51 +02:00

13 lines
468 B
TypeScript

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