Add GetProfileByProfileIdNoAuthAsync method and update related controller logic

This commit is contained in:
Suphonchai Phoonsawat 2026-02-11 11:47:49 +07:00
parent a2ac05ed61
commit e5e7c77880
4 changed files with 49 additions and 7 deletions

View file

@ -500,11 +500,11 @@ namespace BMA.EHR.Leave.Service.Controllers
[HttpPut("schedule")]
[AllowAnonymous]
public async Task<ActionResult<ResponseObject>> ScheduleLeaveBeginning([FromBody] EditLeaveBeginningDto req)
public async Task<ActionResult<ResponseObject>> ScheduleUpdateLeaveBeginningAsync([FromBody] EditLeaveBeginningDto req)
{
try
{
var profile = await _userProfileRepository.GetProfileByProfileIdAsync(req.ProfileId, AccessToken);
var profile = await _userProfileRepository.GetProfileByProfileIdNoAuthAsync(req.ProfileId, AccessToken);
if(profile == null)
{
return Error("ไม่พบข้อมูลข้าราชการหรือลูกจ้าง", StatusCodes.Status404NotFound);