fix sort api/v1/leave/search (#1852)
Some checks failed
release-dev / release-dev (push) Failing after 12s

This commit is contained in:
AdisakKanthawilang 2025-10-08 17:23:10 +07:00 committed by GitHub
parent f784205412
commit fe4a174bf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,6 +26,7 @@ using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using Swashbuckle.AspNetCore.Annotations;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
@ -1862,21 +1863,15 @@ namespace BMA.EHR.Leave.Service.Controllers
{
case "CITIZENID":
if (req.descending == true)
profile = profile.OrderByDescending(x => x.CitizenId).ToList();
resultSet = resultSet.OrderByDescending(x => x.CitizenId).ToList();
else
profile = profile.OrderBy(x => x.CitizenId).ToList();
resultSet = resultSet.OrderBy(x => x.CitizenId).ToList();
break;
case "FULLNAME":
if (req.descending == true)
profile = profile.OrderByDescending(x => x.Prefix)
.ThenByDescending(x => x.FirstName)
.ThenByDescending(x => x.LastName)
.ToList();
resultSet = resultSet.OrderByDescending(x => x.FullName).ToList();
else
profile = profile.OrderBy(x => x.Prefix)
.ThenBy(x => x.FirstName)
.ThenBy(x => x.LastName)
.ToList();
resultSet = resultSet.OrderBy(x => x.FullName).ToList();
break;
case "STARTTIMEMORNING":
if (req.descending == true)