Update LeaveRequestRepository to order leave requests by creation date instead of start date #2305
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m44s

This commit is contained in:
Suphonchai Phoonsawat 2026-02-19 15:19:41 +07:00
parent 65feb994ee
commit 869defcc7e

View file

@ -579,7 +579,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
.Where(x => x.Type.Id == leaveTypeId)
.Where(x => x.LeaveStatus == "APPROVE" || x.LeaveStatus == "DELETING")
//.Where(x => x.LeaveStatus != "REJECT" && x.LeaveStatus != "DELETE")
.OrderByDescending(x => x.LeaveStartDate.Date)
.OrderByDescending(x => x.CreatedAt)
.FirstOrDefaultAsync();
return data;