mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-21 23:22:56 -05:00
7224e24054
Port f587ff643f552a32a1c43e103a474a5065cd3657 to glitch-soc Co-authored-by: Eugen Rochko <eugen@zeonfederated.com> Co-authored-by: Claire <claire.github-309c@sitedethib.com> Signed-off-by: Claire <claire.github-309c@sitedethib.com>
19 lines
588 B
TypeScript
19 lines
588 B
TypeScript
import api, { apiRequest, getLinks } from 'flavours/glitch/api';
|
|
import type { ApiNotificationGroupJSON } from 'flavours/glitch/api_types/notifications';
|
|
|
|
export const apiFetchNotifications = async (params?: {
|
|
exclude_types?: string[];
|
|
max_id?: string;
|
|
}) => {
|
|
const response = await api().request<ApiNotificationGroupJSON[]>({
|
|
method: 'GET',
|
|
url: '/api/v2_alpha/notifications',
|
|
params,
|
|
});
|
|
|
|
return { notifications: response.data, links: getLinks(response) };
|
|
};
|
|
|
|
export const apiClearNotifications = () =>
|
|
apiRequest<undefined>('POST', 'v1/notifications/clear');
|