fix: Change Profile Link to Guid

This commit is contained in:
Suphonchai Phoonsawat 2024-06-11 09:34:06 +07:00
parent ee2a0f1e36
commit b7120551b5
6 changed files with 1213 additions and 47 deletions

View file

@ -312,7 +312,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
// insert to profile leave
var profileLeave = await _appDbContext.Set<ProfileLeave>()
.Where(x => x.TypeLeave.Id == leaveType.Id)
.Where(x => x.Profile.Id == profile.Id)
.Where(x => x.ProfileId == profile.Id)
.Where(x => x.DateStartLeave == rawData.LeaveStartDate && x.DateEndLeave == rawData.LeaveEndDate)
.FirstOrDefaultAsync();
if (profileLeave != null)
@ -430,7 +430,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
Status = "approve",
Reason = rawData.LeaveDetail,
Profile = profile,
ProfileId = profile.Id, // change from profile object to id
TypeLeave = leaveType
};
_appDbContext.Set<ProfileLeave>().Add(profileLeave);