mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
544 migrate to react query v4 (#547)
* Update all imports * Update isLoading * Update onlineManager
This commit is contained in:
@ -6,25 +6,26 @@ import {
|
||||
UseMutationOptions,
|
||||
useQuery,
|
||||
UseQueryOptions
|
||||
} from 'react-query'
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
export type QueryKeyRelationship = [
|
||||
'Relationship',
|
||||
{ id: Mastodon.Account['id'] }
|
||||
]
|
||||
|
||||
const queryFunction = ({
|
||||
const queryFunction = async ({
|
||||
queryKey
|
||||
}: QueryFunctionContext<QueryKeyRelationship>) => {
|
||||
const { id } = queryKey[1]
|
||||
|
||||
return apiInstance<Mastodon.Relationship[]>({
|
||||
const res = await apiInstance<Mastodon.Relationship[]>({
|
||||
method: 'get',
|
||||
url: `accounts/relationships`,
|
||||
params: {
|
||||
'id[]': id
|
||||
}
|
||||
}).then(res => res.body)
|
||||
})
|
||||
return res.body
|
||||
}
|
||||
|
||||
const useRelationshipQuery = ({
|
||||
|
Reference in New Issue
Block a user