fix #2591
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m46s

This commit is contained in:
Suphonchai Phoonsawat 2026-07-06 12:27:52 +07:00
parent def3992d44
commit 43740ec9b2
2 changed files with 2 additions and 3 deletions

View file

@ -6,7 +6,9 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
public class LeaveDocument : EntityBase
{
public Document Document { get; set; }
public Guid DocumentId { get; set; }
public LeaveRequest LeaveRequest { get; set; }
public Guid LeaveRequestId { get; set; }
}
}

View file

@ -315,8 +315,6 @@ namespace BMA.EHR.Leave.Service.Controllers
if (doc != null)
{
leaveRequest.LeaveDocument.Add(new LeaveDocument { Document = doc });
var a = leaveRequest.LeaveDocument.Last();
_context.Entry(a).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
}
}
}
@ -328,7 +326,6 @@ namespace BMA.EHR.Leave.Service.Controllers
if (doc != null)
{
leaveRequest.LeaveDraftDocument = doc;
_context.Entry(leaveRequest.LeaveDraftDocument).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
}
}