2024-07-26 19:36:54 +10:00
|
|
|
import { createAction } from '@reduxjs/toolkit';
|
|
|
|
|
2024-06-18 23:23:30 +10:00
|
|
|
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),
|
|
|
|
);
|
2024-07-26 19:36:54 +10:00
|
|
|
|
|
|
|
export const decreasePendingNotificationsCount = createAction<number>(
|
|
|
|
'notificationPolicy/decreasePendingNotificationCount',
|
|
|
|
);
|