mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-11 12:49:03 +01:00
0e18e1ba31
Port dfd43869c9
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
22 lines
783 B
TypeScript
22 lines
783 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 decreasePendingNotificationsCount = createAction<number>(
|
|
'notificationPolicy/decreasePendingNotificationCount',
|
|
);
|