Merge pull request #17709 from abpframework/auto-merge/rel-7-3/2198

Merge branch rel-7.4 with rel-7.3
pull/17711/head
Berkan Sasmaz 1 year ago committed by GitHub
commit f6dc9e7a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -114,7 +114,21 @@ public class JQueryProxyScriptGenerator : IProxyScriptGenerator, ITransientDepen
if (versionParam != null)
{
var version = FindBestApiVersion(action);
script.AppendLine($" var {ProxyScriptingJsFuncHelper.NormalizeJsVariableName(versionParam.Name)} = api_version ? api_version : '{version}';");
if (parameterList.Contains("api_version"))
{
script.AppendLine($" var {ProxyScriptingJsFuncHelper.NormalizeJsVariableName(versionParam.Name)} = api_version ? api_version : '{version}';");
}
else
{
var apiVersion = action.Parameters.FirstOrDefault(p =>
p.BindingSourceId.IsIn(ParameterBindingSources.ModelBinding, ParameterBindingSources.Query) &&
p.Name == "api-version");
if (apiVersion != null && parameterList.Contains(apiVersion.NameOnMethod))
{
var apiVersionVariable = ProxyScriptingJsFuncHelper.GetParamNameInJsFunc(apiVersion);
script.AppendLine($" {apiVersionVariable} = {apiVersionVariable} ? {apiVersionVariable} : '{version}';");
}
}
}
script.AppendLine(" return abp.ajax($.extend(true, {");

Loading…
Cancel
Save