Skip to content

Commit

Permalink
chore(swagger-zodios): export endpoints too
Browse files Browse the repository at this point in the history
  • Loading branch information
b6pzeusbc54tvhw5jgpyw8pwz2x6gs committed Dec 25, 2023
1 parent aae446a commit 54c3a7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/swagger-zodios/src/components/Definitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function Template({
}: TemplateProps): ReactNode {
return (
<>
{`const endpoints = makeApi([${definitions.join(',')}])`}
{`export const endpoints = makeApi([${definitions.join(',')}])`}
{`export const getAPI = (baseUrl: string) => new Zodios(baseUrl, endpoints)`}

Check warning on line 31 in packages/swagger-zodios/src/components/Definitions.tsx

View check run for this annotation

Codecov / codecov/patch

packages/swagger-zodios/src/components/Definitions.tsx#L30-L31

Added lines #L30 - L31 were not covered by tests
{baseURL && `export const ${name} = new Zodios('${baseURL}', endpoints)`}
{!baseURL && `export const ${name} = new Zodios(endpoints)`}
{`export default ${name}`}
Expand Down

0 comments on commit 54c3a7e

Please sign in to comment.