mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-12-02 13:00:28 -05:00
23 lines
753 B
TypeScript
23 lines
753 B
TypeScript
import { createAction } from '@reduxjs/toolkit';
|
|
|
|
import {
|
|
apiGetNotificationPolicy,
|
|
apiUpdateNotificationsPolicy,
|
|
} from 'mastodon/api/notification_policies';
|
|
import type { NotificationPolicy } from 'mastodon/models/notification_policy';
|
|
import { createDataLoadingThunk } from 'mastodon/store/typed_functions';
|
|
|
|
export const fetchNotificationPolicy = createDataLoadingThunk(
|
|
'notificationPolicy/fetch',
|
|
() => apiGetNotificationPolicy(),
|
|
);
|
|
|
|
export const updateNotificationsPolicy = createDataLoadingThunk(
|
|
'notificationPolicy/update',
|
|
(policy: Partial<NotificationPolicy>) => apiUpdateNotificationsPolicy(policy),
|
|
);
|
|
|
|
export const decreasePendingRequestsCount = createAction<number>(
|
|
'notificationPolicy/decreasePendingRequestsCount',
|
|
);
|