1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-03-21 23:06:53 +01:00
parent d15e8cb652
commit 543ac86d03
14 changed files with 174 additions and 46 deletions

View File

@ -11,7 +11,7 @@ export type QueryKey = [
}
]
type SearchResult = {
export type SearchResult = {
accounts: Mastodon.Account[]
hashtags: Mastodon.Tag[]
statuses: Mastodon.Status[]
@ -23,7 +23,12 @@ const queryFunction = ({ queryKey }: { queryKey: QueryKey }) => {
version: 'v2',
method: 'get',
url: 'search',
params: { ...(type && { type }), ...(term && { q: term }), limit }
params: {
...(type && { type }),
...(term && { q: term }),
limit,
resolve: true
}
}).then(res => res.body)
}