Fix [Bug สรรหาคัดเลือกผู้พิการ] กรณีสร้างรอบสอบใหม่และอัปรูปและเอกสารเลยระบบ error #1399

This commit is contained in:
Bright 2025-07-09 16:44:55 +07:00
parent 55128d5b43
commit caad36949b

View file

@ -469,7 +469,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
if (req == null) if (req == null)
return Error(GlobalMessages.InvalidRequestParam, (int)HttpStatusCode.BadRequest); return Error(GlobalMessages.InvalidRequestParam, (int)HttpStatusCode.BadRequest);
await _context.PeriodExams.AddAsync(new PeriodExam var periodExam = new PeriodExam
{ {
Year = req.Year, Year = req.Year,
Name = req.Name, Name = req.Name,
@ -492,11 +492,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
LastUpdatedAt = DateTime.Now, LastUpdatedAt = DateTime.Now,
LastUpdateUserId = UserId ?? "", LastUpdateUserId = UserId ?? "",
LastUpdateFullName = FullName ?? "System Administrator", LastUpdateFullName = FullName ?? "System Administrator",
}); };
await _context.PeriodExams.AddAsync(periodExam);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return Success(); return Success(periodExam);
} }
catch (Exception ex) catch (Exception ex)
{ {