using ReserveManagementSystemApi.Services; using ReserveManagementSystemLib.Models; namespace ReserveManagementSystemApi.Controllers { [Route("api/[controller]")] [ApiController] public class AuditHistoryController : ControllerBase { private readonly IAuditHistoryService _auditHistoryService; public AuditHistoryController(IAuditHistoryService auditHistoryService) { _auditHistoryService = auditHistoryService; } [HttpGet(Name = "GetAllHistory")] [ProducesResponseType(typeof(IEnumerable), 200)] [ProducesResponseType(500)] public async Task Get() { try { var result = await _auditHistoryService.GetAllAsync(); return Ok(result); } catch (Exception e) { Log.Error(e, "Failure returning Audit Histories"); return StatusCode(StatusCodes.Status500InternalServerError); } } } }