From 0b1c06745abc81e71e5e836a8b07003f1fc6fd72 Mon Sep 17 00:00:00 2001 From: dphuang2 Date: Tue, 10 Oct 2023 19:37:06 -0700 Subject: [PATCH] if includeFetchAdapter then set use fetch by default --- .../resources/typescript-axios/api_doc_example_setup.mustache | 4 ---- .../main/resources/typescript-axios/configuration.mustache | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/generator/konfig-generator-api/src/main/resources/typescript-axios/api_doc_example_setup.mustache b/generator/konfig-generator-api/src/main/resources/typescript-axios/api_doc_example_setup.mustache index d3f3d054e8..abd65fa642 100644 --- a/generator/konfig-generator-api/src/main/resources/typescript-axios/api_doc_example_setup.mustache +++ b/generator/konfig-generator-api/src/main/resources/typescript-axios/api_doc_example_setup.mustache @@ -7,10 +7,6 @@ const {{{clientNameLowercase}}} = new {{{clientName}}}({ {{{apiDocumentationAuthenticationPartial}}} {{/apiDocumentationAuthenticationPartial}} {{^apiDocumentationAuthenticationPartial}} -{{#includeFetchAdapter}} - // Use native Fetch API instead of axios - // useFetch: true, -{{/includeFetchAdapter}} {{> api_doc_example_setup_parameters}} {{/apiDocumentationAuthenticationPartial}} }) \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/typescript-axios/configuration.mustache b/generator/konfig-generator-api/src/main/resources/typescript-axios/configuration.mustache index 977b43afeb..93b1f3af8b 100644 --- a/generator/konfig-generator-api/src/main/resources/typescript-axios/configuration.mustache +++ b/generator/konfig-generator-api/src/main/resources/typescript-axios/configuration.mustache @@ -141,7 +141,7 @@ export class Configuration { this.basePath = param.basePath; this.baseOptions = param.baseOptions ?? {}; {{#includeFetchAdapter}} - if (param.useFetch) { + if (param.useFetch ?? true) { this.baseOptions["adapter"] = fetchAdapter } {{/includeFetchAdapter}}