design report แนวนอน

This commit is contained in:
Kittapath 2023-10-09 15:45:40 +07:00
parent 786334d8bb
commit 4a383f251b
9 changed files with 17 additions and 6 deletions

View file

@ -1257,13 +1257,14 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var person = await _context.PlacementProfiles
.Include(x => x.PlacementProfileDocs)
.ThenInclude(x => x.Document)
.FirstOrDefaultAsync(x => x.Id == personalId);
if (person == null)
return Error(GlobalMessages.DataNotFound, 404);
var profileDoc = person.PlacementProfileDocs.FirstOrDefault(x => x.Id == docId);
var profileDoc = person.PlacementProfileDocs.FirstOrDefault(x => x.Document.Id == docId);
if (profileDoc == null)
return Error(GlobalMessages.CertificateNotFound, 404);
return Error(GlobalMessages.FileNotFoundOnServer, 404);
_context.PlacementProfileDocs.RemoveRange(profileDoc);
var _docId = profileDoc.Document.Id;
await _context.SaveChangesAsync();