Fix Bug สมัครสอบเพิ่มรูปโปรไฟล์ระบบแจ้ง Error

This commit is contained in:
Bright 2025-07-11 12:07:50 +07:00
parent 8b5a46cb52
commit 39da79a893

View file

@ -1259,9 +1259,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (candidate == null)
throw new Exception(GlobalMessages.ExamNotFound);
string profileImgId = candidate.ProfileImg.Id.ToString();
if (candidate.ProfileImg != null)
{
string profileImgId = candidate.ProfileImg.Id.ToString();
//ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo
candidate.ProfileImg = null;
await _context.SaveChangesAsync();
@ -1286,9 +1286,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (candidate == null)
throw new Exception(GlobalMessages.ExamNotFound);
string profileImgId = candidate.ProfileImg.Id.ToString();
if (candidate.ProfileImg != null)
{
string profileImgId = candidate.ProfileImg.Id.ToString();
//ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo
candidate.ProfileImg = null;
await _context.SaveChangesAsync();