diff --git a/docs/rest/api/RestEndpoint.md b/docs/rest/api/RestEndpoint.md index b24cd2c27a74..d9deb055b576 100644 --- a/docs/rest/api/RestEndpoint.md +++ b/docs/rest/api/RestEndpoint.md @@ -538,7 +538,7 @@ used** in any way - this only determines [typing](#typing). This is only used by endpoings with a method that uses body: 'POST', 'PUT', 'PATCH'. - + ```ts {4} const updateSite = new RestEndpoint({ @@ -550,7 +550,7 @@ const updateSite = new RestEndpoint({ updateSite({ slug: 'cool' }, { url: '/' }); ``` - + ### paginationField diff --git a/docs/rest/api/createResource.md b/docs/rest/api/createResource.md index bea903a8e4f0..3d5d7c225439 100644 --- a/docs/rest/api/createResource.md +++ b/docs/rest/api/createResource.md @@ -302,7 +302,7 @@ Commonly used with [useSuspense()](/docs/api/useSuspense), [Controller.invalidat [RestEndpoint.push](./RestEndpoint.md#push) creates a new entity and pushes it to the end of getList. Use [getList.unshift](#unshift) to place at the beginning instead. - + ```typescript title="Post" collapsed export default class Post extends Entity { @@ -349,7 +349,7 @@ Commonly used with [Controller.fetch](/docs/api/Controller#fetch) [RestEndpoint.unshift](./RestEndpoint.md#unshift) creates a new entity and pushes it to the beginning of getList. - + ```typescript title="Post" collapsed export default class Post extends Entity { @@ -449,7 +449,7 @@ Commonly used with [Controller.fetch](/docs/api/Controller#fetch) Update an entity. - + ```typescript title="Post" collapsed export default class Post extends Entity { @@ -495,7 +495,7 @@ Commonly used with [Controller.fetch](/docs/api/Controller#fetch) Update some subset of fields of an entity. - + ```typescript title="Post" collapsed export default class Post extends Entity { diff --git a/packages/rest/typescript-tests/types.test.ts b/packages/rest/typescript-tests/types.test.ts index ceb1af5a67fc..75b6c63733c2 100644 --- a/packages/rest/typescript-tests/types.test.ts +++ b/packages/rest/typescript-tests/types.test.ts @@ -257,9 +257,7 @@ it('should precisely type function arguments', () => { () => requiredSearch({ userId: 'hi' }, { userId: 'hi' }); () => undef(); - // @ts-ignore TODO () => undef({}); - // @ts-ignore TODO () => undef({ id: '5' }); // @ts-expect-error () => undef({ userId: 'hi' }); @@ -412,9 +410,7 @@ it('should precisely type function arguments', () => { () => requiredSearch({ userId: 'hi' }, { userId: 'hi' }); () => undef(); - // @ts-ignore TODO () => undef({}); - // @ts-ignore TODO () => undef({ id: '5' }); // @ts-expect-error () => undef(5); diff --git a/scripts/testSetupNative.js b/scripts/testSetupNative.js index 86eedcce58b5..216f33b3b059 100644 --- a/scripts/testSetupNative.js +++ b/scripts/testSetupNative.js @@ -1,5 +1,4 @@ import('node-fetch').then(({ default: fetch }) => { - // @ts-ignore // eslint-disable-next-line no-undef globalThis.fetch = fetch; }); diff --git a/website/src/components/HTTP/Request.tsx b/website/src/components/HTTP/Request.tsx index 671902602481..0dc1f44f18e3 100644 --- a/website/src/components/HTTP/Request.tsx +++ b/website/src/components/HTTP/Request.tsx @@ -8,6 +8,9 @@ export default function Request({ input, init }: Props) { Object.entries(init.headers).forEach(([key, value]) => { text += `\n${key}: ${value}`; }); + if (init.body) { + text += `\n${'Body'}: ${init.body}`; + } return (
Request