From 2a2cd666bd6ed7f8e160c9f2336b85ec1df14dc4 Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 7 May 2024 17:56:41 +0200 Subject: [PATCH] [JSApiClient] Fix chemin mal converti --- TopModel.Generator.Javascript/GeneratorRegistration.cs | 2 +- TopModel.Generator.Javascript/JavascriptConfig.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/TopModel.Generator.Javascript/GeneratorRegistration.cs b/TopModel.Generator.Javascript/GeneratorRegistration.cs index 85b5f0fe..dc449273 100644 --- a/TopModel.Generator.Javascript/GeneratorRegistration.cs +++ b/TopModel.Generator.Javascript/GeneratorRegistration.cs @@ -15,7 +15,7 @@ public void Register(IServiceCollection services, JavascriptConfig config, int n TrimSlashes(config, c => c.ApiClientFilePath); if (!config.ApiClientFilePath.Contains("{fileName}")) { - config.ApiClientFilePath = config.ApiClientFilePath + "/{fileName}"; + config.ApiClientFilePath = Path.Combine(config.ApiClientFilePath, "{fileName}").Replace("\\", "/"); } } else if (config.ApiMode == TargetFramework.ANGULAR) diff --git a/TopModel.Generator.Javascript/JavascriptConfig.cs b/TopModel.Generator.Javascript/JavascriptConfig.cs index a7e16824..87f2955f 100644 --- a/TopModel.Generator.Javascript/JavascriptConfig.cs +++ b/TopModel.Generator.Javascript/JavascriptConfig.cs @@ -138,8 +138,7 @@ public string GetEndpointsFileName(ModelFile file, string tag) return Path.Combine( OutputDirectory, ResolveVariables(ApiClientRootPath!, tag), - ResolveVariables(ApiClientFilePath!, module: file.Namespace.ModulePathKebab) - .Replace("{fileName}", file.Options.Endpoints.FileName.ToKebabCase())) + ".ts" + ResolveVariables(ApiClientFilePath!, module: file.Namespace.ModulePathKebab).Replace("{fileName}", file.Options.Endpoints.FileName.ToKebabCase()) + ".ts") .Replace("\\", "/"); }