mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Basic new react-navigation types
This commit is contained in:
@ -87,7 +87,9 @@ const queryFunction = async ({
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const res1 = await apiInstance<(Mastodon.Status & { _pinned: boolean} )[]>({
|
||||
const res1 = await apiInstance<
|
||||
(Mastodon.Status & { _pinned: boolean })[]
|
||||
>({
|
||||
method: 'get',
|
||||
url: `accounts/${account}/statuses`,
|
||||
params: {
|
||||
@ -105,7 +107,7 @@ const queryFunction = async ({
|
||||
exclude_replies: 'true'
|
||||
}
|
||||
})
|
||||
return await {
|
||||
return {
|
||||
body: uniqBy([...res1.body, ...res2.body], 'id'),
|
||||
...(res2.links.next && { links: { next: res2.links.next } })
|
||||
}
|
||||
@ -175,8 +177,12 @@ const queryFunction = async ({
|
||||
method: 'get',
|
||||
url: `statuses/${toot}/context`
|
||||
})
|
||||
return await {
|
||||
body: [...res2_1.body.ancestors, res1_1.body, ...res2_1.body.descendants]
|
||||
return {
|
||||
body: [
|
||||
...res2_1.body.ancestors,
|
||||
res1_1.body,
|
||||
...res2_1.body.descendants
|
||||
]
|
||||
}
|
||||
default:
|
||||
return Promise.reject()
|
||||
|
@ -1,10 +1,11 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import { TabSharedStackParamList } from '@utils/navigation/navigators'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useInfiniteQuery, UseInfiniteQueryOptions } from 'react-query'
|
||||
|
||||
export type QueryKeyUsers = [
|
||||
'Users',
|
||||
Nav.TabSharedStackParamList['Tab-Shared-Users']
|
||||
TabSharedStackParamList['Tab-Shared-Users']
|
||||
]
|
||||
|
||||
const queryFunction = ({
|
||||
|
Reference in New Issue
Block a user