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,14 +27,18 @@ interface NitroFetchOptions<R extends NitroFetchRequest, M extends AvailableRout
|
||||
|
||||
type ComputedFetchOptions<R extends NitroFetchRequest, M extends AvailableRouterMethod<R>> = ComputedOptions<NitroFetchOptions<R, M>>
|
||||
|
||||
export interface UseFetchOptions<
|
||||
export type UseFetchOptions<
|
||||
ResT,
|
||||
DataT = ResT,
|
||||
PickKeys extends KeysOf<DataT> = KeysOf<DataT>,
|
||||
DefaultT = undefined,
|
||||
R extends NitroFetchRequest = string & {},
|
||||
M extends AvailableRouterMethod<R> = AvailableRouterMethod<R>,
|
||||
> extends Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'watch'>, ComputedFetchOptions<R, M> {
|
||||
> = Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'watch'> &
|
||||
(M extends 'GET' | 'get'
|
||||
? Omit<ComputedFetchOptions<R, M>, 'body'>
|
||||
: ComputedFetchOptions<R, M>
|
||||
) & {
|
||||
key?: string
|
||||
$fetch?: typeof globalThis.$fetch
|
||||
watch?: MultiWatchSources | false
|
||||
|
Loading…
Reference in New Issue
Block a user