mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
[Glitch] Grouped Notifications UI
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>
This commit is contained in:
18
app/javascript/flavours/glitch/api/notifications.ts
Normal file
18
app/javascript/flavours/glitch/api/notifications.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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');
|
||||
Reference in New Issue
Block a user