1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
No physical phone to test
This commit is contained in:
xmflsct
2022-12-10 00:31:11 +01:00
parent 1b58bcad3e
commit e7fb9ed452
7 changed files with 115 additions and 175 deletions

View File

@ -10,10 +10,10 @@ import { useMutation, useQuery, UseQueryOptions } from 'react-query'
type AccountWithSource = Mastodon.Account & Required<Pick<Mastodon.Account, 'source'>>
type QueryKeyProfile = ['Profile']
export type QueryKeyProfile = ['Profile']
const queryKey: QueryKeyProfile = ['Profile']
const queryFunction = async () => {
const queryFunctionProfile = async () => {
const res = await apiInstance<AccountWithSource>({
method: 'get',
url: `accounts/verify_credentials`
@ -26,7 +26,7 @@ const useProfileQuery = (
options: UseQueryOptions<AccountWithSource, AxiosError>
} | void
) => {
return useQuery(queryKey, queryFunction, params?.options)
return useQuery(queryKey, queryFunctionProfile, params?.options)
}
type MutationVarsProfileBase =
@ -155,4 +155,4 @@ const useProfileMutation = () => {
)
}
export { useProfileQuery, useProfileMutation }
export { queryFunctionProfile, useProfileQuery, useProfileMutation }