diff --git a/TopModel.Generator.Javascript/AngularApiClientGenerator.cs b/TopModel.Generator.Javascript/AngularApiClientGenerator.cs index 1f086d47..c5387f63 100644 --- a/TopModel.Generator.Javascript/AngularApiClientGenerator.cs +++ b/TopModel.Generator.Javascript/AngularApiClientGenerator.cs @@ -206,9 +206,9 @@ private void WriteEndpoint(Endpoint endpoint, FileWriter fw) fw.WriteLine(); } - if (returnType == "string") + if (returnType == "string" || returnType == "Blob" || returnType == "ArrayBuffer") { - fw.Write(2, $@"return {(Config.ApiMode == TargetFramework.ANGULAR_PROMISE ? "lastValueFrom(" : string.Empty)}this.http.{endpoint.Method.ToLower()}(`/{fullRoute}`"); + fw.Write(2, $@"return {(Config.ApiMode == TargetFramework.ANGULAR_PROMISE ? "lastValueFrom(" : string.Empty)}this.http.{endpoint.Method.ToLower()}(`/{fullRoute}`"); } else { @@ -228,9 +228,9 @@ private void WriteEndpoint(Endpoint endpoint, FileWriter fw) fw.Write(", {}"); } - if (returnType == "string") + if (returnType == "string" || returnType == "Blob" || returnType == "ArrayBuffer") { - fw.Write($", {{responseType: 'text'}}"); + fw.Write($", {{responseType: '{returnType.ToLower()}'}}"); } if (endpoint.GetQueryParams().Any())