Skip to content

Commit

Permalink
[Angular] Correction fullroute dans le cas multipart
Browse files Browse the repository at this point in the history
  • Loading branch information
gideruette committed Nov 9, 2023
1 parent 8d6a2f8 commit 1f80d97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TopModel.Generator.Javascript/AngularApiClientGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void WriteEndpoint(Endpoint endpoint, FileWriter fw)
fw.WriteLine();
fw.WriteLine(1, "/**");
fw.WriteLine(1, $" * @description {endpoint.Description}");

var fullRoute = endpoint.FullRoute.Replace("{", "${");
foreach (var param in endpoint.Params)
{
fw.WriteLine(1, $" * @param {param.GetParamName()} {param.Comment}");
Expand Down Expand Up @@ -173,7 +173,7 @@ private void WriteEndpoint(Endpoint endpoint, FileWriter fw)
fw.WriteLine(" formData");
fw.WriteLine(" );");

fw.WriteLine(2, $@"return this.http.{endpoint.Method.ToLower()}<{returnType}>(`/{endpoint.FullRoute}`, formData);");
fw.WriteLine(2, $@"return this.http.{endpoint.Method.ToLower()}<{returnType}>(`/{fullRoute}`, formData);");
fw.WriteLine("}");
return;
}
Expand All @@ -196,11 +196,11 @@ private void WriteEndpoint(Endpoint endpoint, FileWriter fw)

if (returnType == "string")
{
fw.Write(2, $@"return this.http.{endpoint.Method.ToLower()}(`/{endpoint.FullRoute.Replace("{", "${")}`");
fw.Write(2, $@"return this.http.{endpoint.Method.ToLower()}(`/{fullRoute}`");
}
else
{
fw.Write(2, $@"return this.http.{endpoint.Method.ToLower()}<{returnType}>(`/{endpoint.FullRoute.Replace("{", "${")}`");
fw.Write(2, $@"return this.http.{endpoint.Method.ToLower()}<{returnType}>(`/{fullRoute}`");
}

if (endpoint.GetJsonBodyParam() != null)
Expand Down

0 comments on commit 1f80d97

Please sign in to comment.