Skip to content

Commit

Permalink
feat: rename service instance variable
Browse files Browse the repository at this point in the history
  • Loading branch information
shijistar committed Feb 2, 2025
1 parent 3b557ae commit 4e99eea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swagger-api-hub",
"version": "1.2.2",
"version": "1.2.3",
"description": "Generate front-end access code for swagger backend services in one click",
"keywords": [
"OpenApi",
Expand Down
8 changes: 4 additions & 4 deletions templates/api.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%
<%
// modified based on swagger-typescript-api v13.0.3
%>
// @ts-nocheck
<%
<%
const { utils, route, config, apiConfig, modelTypes } = it;
const { _, pascalCase, require } = utils;
const apiClassName = pascalCase(route.moduleName);
Expand All @@ -12,7 +12,7 @@ const dataContracts = _.map(modelTypes, "name");

<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %>
import type { AxiosInstance } from "axios";
import type { ApiConfig } from "<%~ config.httpClientFile ?? `./${config.fileNames.httpClient}` %>";
import type { ApiConfig } from "<%~ config.httpClientFile ?? `./${config.fileNames.httpClient}` %>";
<% } %>
import { HttpClient, RequestParams, ContentType, HttpResponse } from "<%~ config.httpClientFile ?? `./${config.fileNames.httpClient}` %>";
<% if (dataContracts.length) { %>
Expand Down Expand Up @@ -49,5 +49,5 @@ export class <%= apiClassName %>Class<SecurityDataType = unknown><% if (!config.
}
<% if (config.createApiInstance) { %>
export const <%= apiClassName %> = new <%= apiClassName %>Class();
export const <%= apiClassName %>Api = new <%= apiClassName %>Class();
<% } %>

0 comments on commit 4e99eea

Please sign in to comment.