Skip to content

Commit

Permalink
Merge pull request #202 from dotnetcore/bugfix/on-syslog-page-can-not…
Browse files Browse the repository at this point in the history
…-loading-app-list

Fixbug: can not search app when sort direction is null
  • Loading branch information
kklldog authored Dec 1, 2024
2 parents 3177b04 + 73bb0ac commit 2ea36e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssemblyVersion>1.9.8</AssemblyVersion>
<Version>1.9.7</Version>
<PackageVersion>1.9.8</PackageVersion>
<AssemblyVersion>1.9.9</AssemblyVersion>
<Version>1.9.9</Version>
<PackageVersion>1.9.9</PackageVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<FileVersion>1.9.8</FileVersion>
<FileVersion>1.9.9</FileVersion>
<Authors>kklldog</Authors>
<Company>kklldog</Company>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/AgileConfig.Server.Service/AppService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public Task<List<App>> GetAllAppsAsync()
}

var apps = await _appRepository.QueryPageAsync(exp, current, pageSize, sortField,
ascOrDesc.StartsWith("asc") ? "ASC" : "DESC");
ascOrDesc?.StartsWith("asc") ?? true ? "ASC" : "DESC");
var count = await _appRepository.CountAsync(exp);

return (apps, count);
Expand Down Expand Up @@ -230,7 +230,7 @@ public Task<List<App>> GetAllAppsAsync()

if (sortProperty.TryGetValue(sortField, out var propertyInfo))
{
appGroupList = ascOrDesc.StartsWith("asc")
appGroupList = ascOrDesc?.StartsWith("asc") ?? true
? appGroupList.OrderBy(x => propertyInfo.GetValue(x.App, null)).ToList()
: appGroupList.OrderByDescending(x => propertyInfo.GetValue(x.App, null)).ToList();
}
Expand Down

0 comments on commit 2ea36e1

Please sign in to comment.