1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Fine tune announcements

This commit is contained in:
Zhiyuan Zheng
2020-12-23 15:57:20 +01:00
parent eeee40b49a
commit 4461cd1fa4
10 changed files with 72 additions and 17 deletions

View File

@ -1,10 +1,21 @@
import client from '@api/client'
export const announcementFetch = async (): Promise<Mastodon.Announcement[]> => {
export const announcementFetch = async ({
queryKey
}: {
queryKey: QueryKey.Announcements
}): Promise<Mastodon.Announcement[]> => {
const [_, { showAll }] = queryKey
const res = await client({
method: 'get',
instance: 'local',
url: `announcements`
url: `announcements`,
...(showAll && {
params: {
with_dismissed: 'true'
}
})
})
return Promise.resolve(res.body)
}