fix : create and edit leave request
This commit is contained in:
parent
9c696be46e
commit
8ad90f18f0
2 changed files with 15 additions and 4 deletions
|
|
@ -72,7 +72,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
|
||||
public override async Task<LeaveRequest?> GetByIdAsync(Guid id)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||
.Include(x => x.LeaveDocument)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Include(x => x.LeaveDraftDocument)
|
||||
|
|
@ -112,7 +112,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
// _dbContext.Attatch(entity.LeaveDocument);
|
||||
|
||||
if (entity.Type != null)
|
||||
{
|
||||
|
||||
_dbContext.Attatch(entity.Type);
|
||||
}
|
||||
|
||||
|
||||
return await base.UpdateAsync(entity);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue