#9 #2597
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s

This commit is contained in:
Suphonchai Phoonsawat 2026-07-17 14:02:29 +07:00
parent a299c07b48
commit dcbb845c0e

View file

@ -2744,7 +2744,9 @@ namespace BMA.EHR.Leave.Service.Controllers
if (old != null) if (old != null)
{ {
return Error(new Exception("ไม่สามารถทำรายการได้ เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest); // ลบของเก่าออกเพื่อใส่ของใหม่
await _userDutyTimeRepository.DeleteAsync(old);
//return Error(new Exception("ไม่สามารถทำรายการได้ เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest);
} }
var data = new UserDutyTime var data = new UserDutyTime
@ -2801,8 +2803,8 @@ namespace BMA.EHR.Leave.Service.Controllers
if (old != null) if (old != null)
{ {
continue; // move to next item if already exist, not return error // ลบของเก่าออก เพื่อที่จะใส่รายการใหม่
//return Error(new Exception($"กำหนดรอบลงเวลาของ {req.FirstName} {req.LastName} ผิดพลาด เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest); await _userDutyTimeRepository.DeleteAsync(old);
} }
var data = new UserDutyTime var data = new UserDutyTime