รวม code ปรับปรุงตาม change request จากทีม
This commit is contained in:
@@ -95,5 +95,31 @@ namespace TodoAPI2.Controllers
|
||||
return StatusCode(500, $"Exception while get specific item. {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GetLeaveOfEmployee
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetLeaveOfEmployee")]
|
||||
[ProducesResponseType(typeof(List<employee_leaveViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetLeaveOfEmployee(int employee_id, DateTime? start_date, DateTime? end_date)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Ok(_repository.GetLeaveOfEmployee(employee_id, start_date, end_date));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while get list of items.", ex);
|
||||
return StatusCode(500, $"Exception while get list of items. {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user