You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
722 B
26 lines
722 B
import api, { apiRequest, getLinks } from 'mastodon/api'; |
|
import type { ApiNotificationGroupsResultJSON } from 'mastodon/api_types/notifications'; |
|
|
|
export const apiFetchNotifications = async (params?: { |
|
exclude_types?: string[]; |
|
max_id?: string; |
|
since_id?: string; |
|
}) => { |
|
const response = await api().request<ApiNotificationGroupsResultJSON>({ |
|
method: 'GET', |
|
url: '/api/v2_alpha/notifications', |
|
params, |
|
}); |
|
|
|
const { statuses, accounts, notification_groups } = response.data; |
|
|
|
return { |
|
statuses, |
|
accounts, |
|
notifications: notification_groups, |
|
links: getLinks(response), |
|
}; |
|
}; |
|
|
|
export const apiClearNotifications = () => |
|
apiRequest<undefined>('POST', 'v1/notifications/clear');
|
|
|