Fix สมัครสอบคัดเลือก ถ้าอัปรูปแก้ไขระบบจะแจ้ง error #1377
This commit is contained in:
parent
2d694c79fc
commit
3e1701cfdf
1 changed files with 10 additions and 2 deletions
|
|
@ -1259,9 +1259,13 @@ 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)
|
||||
{
|
||||
await DeleteDocument(candidate.ProfileImg.Id.ToString());
|
||||
//ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo
|
||||
candidate.ProfileImg = null;
|
||||
await _context.SaveChangesAsync();
|
||||
await DeleteDocument(profileImgId);
|
||||
}
|
||||
|
||||
var doc = await _minioService.UploadFileAsync(file);
|
||||
|
|
@ -1282,9 +1286,13 @@ 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)
|
||||
{
|
||||
await DeleteDocument(candidate.ProfileImg.Id.ToString());
|
||||
//ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo
|
||||
candidate.ProfileImg = null;
|
||||
await _context.SaveChangesAsync();
|
||||
await DeleteDocument(profileImgId);
|
||||
}
|
||||
|
||||
var doc = await _minioService.UploadFileAsync(file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue