add limit param to members query
This commit is contained in:
@@ -15,7 +15,7 @@ type RQPageParam = string | undefined
|
|||||||
const RQKEY_ROOT = 'list-members'
|
const RQKEY_ROOT = 'list-members'
|
||||||
export const RQKEY = (uri: string) => [RQKEY_ROOT, uri]
|
export const RQKEY = (uri: string) => [RQKEY_ROOT, uri]
|
||||||
|
|
||||||
export function useListMembersQuery(uri: string) {
|
export function useListMembersQuery(uri: string, limit: number = PAGE_SIZE) {
|
||||||
const agent = useAgent()
|
const agent = useAgent()
|
||||||
return useInfiniteQuery<
|
return useInfiniteQuery<
|
||||||
AppBskyGraphGetList.OutputSchema,
|
AppBskyGraphGetList.OutputSchema,
|
||||||
@@ -29,7 +29,7 @@ export function useListMembersQuery(uri: string) {
|
|||||||
async queryFn({pageParam}: {pageParam: RQPageParam}) {
|
async queryFn({pageParam}: {pageParam: RQPageParam}) {
|
||||||
const res = await agent.app.bsky.graph.getList({
|
const res = await agent.app.bsky.graph.getList({
|
||||||
list: uri,
|
list: uri,
|
||||||
limit: PAGE_SIZE,
|
limit,
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
})
|
})
|
||||||
return res.data
|
return res.data
|
||||||
|
|||||||
Reference in New Issue
Block a user