From 1960f243d00e02ee488525e06d33bf7390d4b9ca Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 12 Jul 2024 14:01:49 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20api=20=E0=B8=A5=E0=B8=87=E0=B9=80?= =?UTF-8?q?=E0=B8=A7=E0=B8=A5=E0=B8=B2=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5?= =?UTF-8?q?=E0=B8=9E=E0=B8=B4=E0=B9=80=E0=B8=A8=E0=B8=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Leave/Controllers/LeaveController.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index 098adcef..5f74aa03 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -1213,20 +1213,22 @@ namespace BMA.EHR.Leave.Service.Controllers foreach (var data in rawData) { - var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId, AccessToken); - if (profile == null) - { - return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); - } + // var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId, AccessToken); + // if (profile == null) + // { + // return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + // } //var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty); - var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(profile.Id); - var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty; - var userRound = await _dutyTimeRepository.GetByIdAsync(roundId); + //var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(profile.Id); + //var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty; + //var userRound = await _dutyTimeRepository.GetByIdAsync(roundId); var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate); - var duty = userRound ?? getDefaultRound; + //var duty = userRound ?? getDefaultRound; + + var duty = getDefaultRound; // create result object to return var resObj = new GetAdditionalCheckRequestDto