add sort to searchPosts request (#3581)
This commit is contained in:
@@ -34,18 +34,13 @@ export function useSearchPostsQuery({
|
|||||||
>({
|
>({
|
||||||
queryKey: searchPostsQueryKey({query, sort}),
|
queryKey: searchPostsQueryKey({query, sort}),
|
||||||
queryFn: async ({pageParam}) => {
|
queryFn: async ({pageParam}) => {
|
||||||
// waiting on new APIs
|
|
||||||
switch (sort) {
|
|
||||||
// case 'top':
|
|
||||||
// case 'latest':
|
|
||||||
default:
|
|
||||||
const res = await getAgent().app.bsky.feed.searchPosts({
|
const res = await getAgent().app.bsky.feed.searchPosts({
|
||||||
q: query,
|
q: query,
|
||||||
limit: 25,
|
limit: 25,
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
|
sort,
|
||||||
})
|
})
|
||||||
return res.data
|
return res.data
|
||||||
}
|
|
||||||
},
|
},
|
||||||
initialPageParam: undefined,
|
initialPageParam: undefined,
|
||||||
getNextPageParam: lastPage => lastPage.cursor,
|
getNextPageParam: lastPage => lastPage.cursor,
|
||||||
|
|||||||
Reference in New Issue
Block a user