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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user