mirror of
https://github.com/funamitech/mastodon
synced 2024-12-14 22:59:46 +09:00
7224e24054
Port f587ff643f
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');
|