From f49e56d82e22de7b21a6224f16c135f80e442e98 Mon Sep 17 00:00:00 2001 From: Arthur <45236453+ArthurMJ96@users.noreply.github.com> Date: Sat, 14 May 2022 22:27:25 +0200 Subject: [PATCH 1/4] docs: add body to UseFetchOptions type & Params section --- docs/content/3.api/1.composables/use-fetch.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/3.api/1.composables/use-fetch.md b/docs/content/3.api/1.composables/use-fetch.md index cb808940877..62f3f7152d4 100644 --- a/docs/content/3.api/1.composables/use-fetch.md +++ b/docs/content/3.api/1.composables/use-fetch.md @@ -13,6 +13,7 @@ function useFetch( type UseFetchOptions = { method?: string, params?: SearchParams, + body?: RequestInit['body'] | Record headers?: {key: string, value: string}[], baseURL?: string, server?: boolean @@ -36,6 +37,7 @@ type DataT = { * **Options (from [ohmyfetch](https://github.com/unjs/ohmyfetch))**: * `method`: Request method * `params`: Query params + * `body`: Request body - automatically stringified (if an object is passed). * `headers`: Request headers * `baseURL`: Base URL for the request * **Options (from `useAsyncData`)**: From c2df64570dadef20bfb3fd9002fbde73d2b80416 Mon Sep 17 00:00:00 2001 From: Arthur <45236453+ArthurMJ96@users.noreply.github.com> Date: Sat, 14 May 2022 22:30:22 +0200 Subject: [PATCH 2/4] docs: add links to extended type definitions --- docs/content/3.api/1.composables/use-fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/3.api/1.composables/use-fetch.md b/docs/content/3.api/1.composables/use-fetch.md index 62f3f7152d4..5cef2e61b82 100644 --- a/docs/content/3.api/1.composables/use-fetch.md +++ b/docs/content/3.api/1.composables/use-fetch.md @@ -34,7 +34,7 @@ type DataT = { ## Params * **Url**: The URL to fetch -* **Options (from [ohmyfetch](https://github.com/unjs/ohmyfetch))**: +* **Options (extends [ohmyfetch's FetchOptions](https://github.com/unjs/ohmyfetch/blob/main/src/fetch.ts#L26) & [AsyncDataOptions](https://github.dev/nuxt/framework/blob/main/packages/nuxt/src/app/composables/asyncData.ts#L14))**: * `method`: Request method * `params`: Query params * `body`: Request body - automatically stringified (if an object is passed). From 859b4d5ed424f2384875052532434317c936048a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 18 May 2022 08:19:26 +0200 Subject: [PATCH 3/4] Update use-fetch.md --- docs/content/3.api/1.composables/use-fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/3.api/1.composables/use-fetch.md b/docs/content/3.api/1.composables/use-fetch.md index 5cef2e61b82..b8764b9e629 100644 --- a/docs/content/3.api/1.composables/use-fetch.md +++ b/docs/content/3.api/1.composables/use-fetch.md @@ -34,7 +34,7 @@ type DataT = { ## Params * **Url**: The URL to fetch -* **Options (extends [ohmyfetch's FetchOptions](https://github.com/unjs/ohmyfetch/blob/main/src/fetch.ts#L26) & [AsyncDataOptions](https://github.dev/nuxt/framework/blob/main/packages/nuxt/src/app/composables/asyncData.ts#L14))**: +* **Options (extends [ohmyfetch's FetchOptions](https://github.com/unjs/ohmyfetch/blob/main/src/fetch.ts#L26) & [AsyncDataOptions](/api/composables/use-async-data#params))**: * `method`: Request method * `params`: Query params * `body`: Request body - automatically stringified (if an object is passed). From 15845593b5702a972a5dd2df0def134c33451999 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Fri, 20 May 2022 11:02:56 +0200 Subject: [PATCH 4/4] Update docs/content/3.api/1.composables/use-fetch.md --- docs/content/3.api/1.composables/use-fetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/3.api/1.composables/use-fetch.md b/docs/content/3.api/1.composables/use-fetch.md index b8764b9e629..1bb036f5a44 100644 --- a/docs/content/3.api/1.composables/use-fetch.md +++ b/docs/content/3.api/1.composables/use-fetch.md @@ -34,7 +34,7 @@ type DataT = { ## Params * **Url**: The URL to fetch -* **Options (extends [ohmyfetch's FetchOptions](https://github.com/unjs/ohmyfetch/blob/main/src/fetch.ts#L26) & [AsyncDataOptions](/api/composables/use-async-data#params))**: +* **Options (extends [unjs/ohmyfetch](https://github.com/unjs/ohmyfetch) options & [AsyncDataOptions](/api/composables/use-async-data#params))**: * `method`: Request method * `params`: Query params * `body`: Request body - automatically stringified (if an object is passed).