cast branded chat convo params with the syntax types
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import {type DidString} from '@atproto/syntax'
|
||||||
import {useQuery} from '@tanstack/react-query'
|
import {useQuery} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {useChatClient} from '#/state/session'
|
import {useChatClient} from '#/state/session'
|
||||||
@@ -18,9 +19,7 @@ export function useGetConvoAvailabilityQuery(
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
return await client.call(chat.bsky.convo.getConvoAvailability, {
|
return await client.call(chat.bsky.convo.getConvoAvailability, {
|
||||||
// callers pass an already-resolved actor did
|
// callers pass an already-resolved actor did
|
||||||
members: [
|
members: [did as DidString],
|
||||||
did,
|
|
||||||
] as chat.bsky.convo.getConvoAvailability.$Params['members'],
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
staleTime: STALE.INFINITY,
|
staleTime: STALE.INFINITY,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {type ChatBskyConvoGetConvoForMembers} from '@atproto/api'
|
import {type ChatBskyConvoGetConvoForMembers} from '@atproto/api'
|
||||||
|
import {type DidString} from '@atproto/syntax'
|
||||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
@@ -20,8 +21,7 @@ export function useGetConvoForMembers({
|
|||||||
mutationFn: async (members: string[]) => {
|
mutationFn: async (members: string[]) => {
|
||||||
return await client.call(chat.bsky.convo.getConvoForMembers, {
|
return await client.call(chat.bsky.convo.getConvoForMembers, {
|
||||||
// callers pass already-resolved actor dids
|
// callers pass already-resolved actor dids
|
||||||
members:
|
members: members as DidString[],
|
||||||
members as chat.bsky.convo.getConvoForMembers.$Params['members'],
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onSuccess: data => {
|
onSuccess: data => {
|
||||||
|
|||||||
Reference in New Issue
Block a user