เช็คtypeประเภทพ้นราชการ

This commit is contained in:
Kittapath 2023-07-25 17:36:05 +07:00
parent ae1ce1078c
commit 40836767ad

View file

@ -159,6 +159,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
.FirstOrDefaultAsync();
if (retire_old != null)
round = retire_old.Round + 1;
if (!type.Trim().ToUpper().Contains("EMPLOYEE") && !type.Trim().ToUpper().Contains("OFFICER"))
return Error("ประเภทพ้นราชการไม่ถูกต้อง");
var retire = new RetirementPeriod
{
@ -450,7 +452,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("{retireId:length(36)}")]
[HttpPost("{retireId:length(36)}")]
public async Task<ActionResult<ResponseObject>> UpdateProfileRetirement(Guid retireId)
{
var retire = await _context.RetirementPeriods