mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix #600
This commit is contained in:
@ -92,7 +92,7 @@ export type ScreenTabsScreenProps<T extends keyof ScreenTabsStackParamList> = Bo
|
||||
|
||||
export type TabSharedStackParamList = {
|
||||
'Tab-Shared-Account': {
|
||||
account: Mastodon.Account | Mastodon.Mention
|
||||
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id'>
|
||||
}
|
||||
'Tab-Shared-Account-In-Lists': {
|
||||
account: Pick<Mastodon.Account, 'id' | 'username'>
|
||||
@ -105,6 +105,7 @@ export type TabSharedStackParamList = {
|
||||
id: Mastodon.Status['id']
|
||||
detectedLanguage: string
|
||||
}
|
||||
'Tab-Shared-Report': { account: Mastodon.Account; status?: Pick<Mastodon.Status, 'id'> }
|
||||
'Tab-Shared-Search': undefined
|
||||
'Tab-Shared-Toot': {
|
||||
toot: Mastodon.Status
|
||||
|
18
src/utils/queryHooks/reports.ts
Normal file
18
src/utils/queryHooks/reports.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useQuery, UseQueryOptions } from '@tanstack/react-query'
|
||||
|
||||
export type QueryKeyRules = ['Rules']
|
||||
|
||||
const queryFunction = () =>
|
||||
apiInstance<Mastodon.Rule[]>({
|
||||
method: 'get',
|
||||
url: 'instance/rules'
|
||||
}).then(res => res.body)
|
||||
|
||||
const useRulesQuery = (params?: { options?: UseQueryOptions<Mastodon.Rule[], AxiosError> }) => {
|
||||
const queryKey: QueryKeyRules = ['Rules']
|
||||
return useQuery(queryKey, queryFunction, params?.options)
|
||||
}
|
||||
|
||||
export { useRulesQuery }
|
Reference in New Issue
Block a user