This commit is contained in:
Suphonchai Phoonsawat 2024-06-20 13:37:25 +07:00
parent 6c09c68c5c
commit 1ae6f5e8d1
23 changed files with 304 additions and 123 deletions

View file

@ -90,7 +90,7 @@ namespace BMA.EHR.Leave.Service.Controllers
get
{
if (UserId != null || UserId != "")
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!));
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!), AccessToken);
else
return Guid.Empty;
}
@ -298,7 +298,7 @@ namespace BMA.EHR.Leave.Service.Controllers
}
// add dear and oc_data
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty);
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
var approver = string.Empty;
if (rootOc != null)
{
@ -524,7 +524,7 @@ namespace BMA.EHR.Leave.Service.Controllers
}
// add dear and oc_data
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty);
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
var approver = string.Empty;
if (rootOc != null)
{
@ -613,7 +613,7 @@ namespace BMA.EHR.Leave.Service.Controllers
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty);
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
var approver = string.Empty;
if (rootOc != null)
{
@ -1423,7 +1423,7 @@ namespace BMA.EHR.Leave.Service.Controllers
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
rawData.Type.Id);
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty);
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
var approver = string.Empty;
if (rootOc != null)
{