mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-31 12:03:10 -05:00
131696277c
Port 0a6b75b71eae0dd9eb9d5d8c73e1d210820eeb51 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
23 lines
774 B
TypeScript
23 lines
774 B
TypeScript
import { createAction } from '@reduxjs/toolkit';
|
|
|
|
import {
|
|
apiGetNotificationPolicy,
|
|
apiUpdateNotificationsPolicy,
|
|
} from 'flavours/glitch/api/notification_policies';
|
|
import type { NotificationPolicy } from 'flavours/glitch/models/notification_policy';
|
|
import { createDataLoadingThunk } from 'flavours/glitch/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',
|
|
);
|