Refactor LeaveBeginningController to simplify duplicate check and comment out LeaveYear property in EditLeaveBeginningDto #2341
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m41s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m41s
This commit is contained in:
parent
006cea048d
commit
f866435897
2 changed files with 3 additions and 4 deletions
|
|
@ -590,8 +590,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error("ไม่พบข้อมูลข้าราชการหรือลูกจ้าง", StatusCodes.Status404NotFound);
|
||||
}
|
||||
// check duplicate
|
||||
var oldData = await _context.LeaveBeginnings.Where(x => x.ProfileId == req.ProfileId
|
||||
&& x.LeaveYear == req.LeaveYear).ToListAsync();
|
||||
var oldData = await _context.LeaveBeginnings.Where(x => x.ProfileId == req.ProfileId).ToListAsync();
|
||||
|
||||
foreach(var item in oldData)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveBeginnings
|
|||
[Required]
|
||||
public Guid ProfileId { get; set; } = Guid.Empty;
|
||||
|
||||
[Required, Comment("ปีงบประมาณ")]
|
||||
public int LeaveYear { get; set; } = 0;
|
||||
// [Required, Comment("ปีงบประมาณ")]
|
||||
// public int LeaveYear { get; set; } = 0;
|
||||
|
||||
public Guid? RootDnaId { get; set; }
|
||||
public Guid? Child1DnaId { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue