add sort to searchPosts request (#3581)
parent
45e572b212
commit
2974b407be
|
@ -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
|
const res = await getAgent().app.bsky.feed.searchPosts({
|
||||||
switch (sort) {
|
q: query,
|
||||||
// case 'top':
|
limit: 25,
|
||||||
// case 'latest':
|
cursor: pageParam,
|
||||||
default:
|
sort,
|
||||||
const res = await getAgent().app.bsky.feed.searchPosts({
|
})
|
||||||
q: query,
|
return res.data
|
||||||
limit: 25,
|
|
||||||
cursor: pageParam,
|
|
||||||
})
|
|
||||||
return res.data
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
initialPageParam: undefined,
|
initialPageParam: undefined,
|
||||||
getNextPageParam: lastPage => lastPage.cursor,
|
getNextPageParam: lastPage => lastPage.cursor,
|
||||||
|
|
Loading…
Reference in New Issue