diff --git a/packages/swagger-ui-plugins/plugins/request-snippets/fetch.spec.ts b/packages/swagger-ui-plugins/plugins/request-snippets/fetch.spec.ts index 4038f46..9121f13 100644 --- a/packages/swagger-ui-plugins/plugins/request-snippets/fetch.spec.ts +++ b/packages/swagger-ui-plugins/plugins/request-snippets/fetch.spec.ts @@ -14,9 +14,8 @@ describe("requestSnippetGenerator_node_fetch", () => { const snippet = requestSnippetGenerator_node_fetch(request); expect(snippet).toMatchInlineSnapshot(` "try { - const response = await fetch({ + const response = await fetch('https://example.com/api/data?query=1', { method: 'GET', - url: 'https://example.com/api/data?query=1', headers: { "Content-Type": "application/json" }, @@ -44,9 +43,8 @@ describe("requestSnippetGenerator_node_fetch", () => { const snippet = requestSnippetGenerator_node_fetch(request); expect(snippet).toMatchInlineSnapshot(` "try { - const response = await fetch({ + const response = await fetch('https://example.com/api/data', { method: 'GET', - url: 'https://example.com/api/data', headers: { "Content-Type": "text/html" }, @@ -72,9 +70,8 @@ describe("requestSnippetGenerator_node_fetch", () => { const snippet = requestSnippetGenerator_node_fetch(request); expect(snippet).toMatchInlineSnapshot(` "try { - const response = await fetch({ + const response = await fetch('https://example.com/api/data', { method: 'GET', - url: 'https://example.com/api/data', headers: { "Content-Type": "application/json" }, diff --git a/packages/swagger-ui-plugins/plugins/request-snippets/fetch.ts b/packages/swagger-ui-plugins/plugins/request-snippets/fetch.ts index dde5626..ba46423 100644 --- a/packages/swagger-ui-plugins/plugins/request-snippets/fetch.ts +++ b/packages/swagger-ui-plugins/plugins/request-snippets/fetch.ts @@ -10,13 +10,11 @@ export function requestSnippetGenerator_node_fetch(request: Map const headersString = headers ? JSON.stringify(headers, null, 2) : ""; const opts = indent( - [`method: '${method}'`, `url: '${url.href}'`, headersString && `headers: ${headersString}`, bodyString && `body: ${bodyString}`] - .filter(Boolean) - .join(",\n") + [`method: '${method}'`, headersString && `headers: ${headersString}`, bodyString && `body: ${bodyString}`].filter(Boolean).join(",\n") ); return `try { - const response = await fetch({ + const response = await fetch('${url}', { ${opts} }) const data = await response.json(); diff --git a/packages/ui/molecules/Forms/Select/Select.stories.tsx b/packages/ui/molecules/Forms/Select/Select.stories.tsx index f409c8d..6a7014e 100644 --- a/packages/ui/molecules/Forms/Select/Select.stories.tsx +++ b/packages/ui/molecules/Forms/Select/Select.stories.tsx @@ -1,7 +1,6 @@ import { Meta, StoryObj } from "@storybook/react"; import { useState } from "react"; -import { JsonEditorField } from "../JsonEditorField"; import { Select } from "./Select"; export default { @@ -25,7 +24,7 @@ export default { } } satisfies Meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {