mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
fix(nuxt): omit the body from useFetch for GET requests (nuxt#20667)
This commit is contained in:
parent
728b7e1c25
commit
5d82bbaa7a
@ -27,18 +27,22 @@ interface NitroFetchOptions<R extends NitroFetchRequest, M extends AvailableRout
|
|||||||
|
|
||||||
type ComputedFetchOptions<R extends NitroFetchRequest, M extends AvailableRouterMethod<R>> = ComputedOptions<NitroFetchOptions<R, M>>
|
type ComputedFetchOptions<R extends NitroFetchRequest, M extends AvailableRouterMethod<R>> = ComputedOptions<NitroFetchOptions<R, M>>
|
||||||
|
|
||||||
export interface UseFetchOptions<
|
export type UseFetchOptions<
|
||||||
ResT,
|
ResT,
|
||||||
DataT = ResT,
|
DataT = ResT,
|
||||||
PickKeys extends KeysOf<DataT> = KeysOf<DataT>,
|
PickKeys extends KeysOf<DataT> = KeysOf<DataT>,
|
||||||
DefaultT = undefined,
|
DefaultT = undefined,
|
||||||
R extends NitroFetchRequest = string & {},
|
R extends NitroFetchRequest = string & {},
|
||||||
M extends AvailableRouterMethod<R> = AvailableRouterMethod<R>,
|
M extends AvailableRouterMethod<R> = AvailableRouterMethod<R>,
|
||||||
> extends Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'watch'>, ComputedFetchOptions<R, M> {
|
> = Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'watch'> &
|
||||||
key?: string
|
(M extends 'GET' | 'get'
|
||||||
$fetch?: typeof globalThis.$fetch
|
? Omit<ComputedFetchOptions<R, M>, 'body'>
|
||||||
watch?: MultiWatchSources | false
|
: ComputedFetchOptions<R, M>
|
||||||
}
|
) & {
|
||||||
|
key?: string
|
||||||
|
$fetch?: typeof globalThis.$fetch
|
||||||
|
watch?: MultiWatchSources | false
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch data from an API endpoint with an SSR-friendly composable.
|
* Fetch data from an API endpoint with an SSR-friendly composable.
|
||||||
|
Loading…
Reference in New Issue
Block a user