Add project files.
This commit is contained in:
25
FaKrosnoApi/Controllers/ErrorLogController.cs
Normal file
25
FaKrosnoApi/Controllers/ErrorLogController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ErrorLogController(IErrorLogService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<ErrorLogDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<ErrorLogDto?> errorLogs = await service.GetAll();
|
||||
return Ok(errorLogs);
|
||||
}
|
||||
|
||||
[HttpGet("by-order-number")]
|
||||
public async Task<ActionResult<IEnumerable<ErrorLogDto>>> GetByCustomerOrderNumber([FromQuery] string customerOrderNumber)
|
||||
{
|
||||
var errorLogs = await service.GetByOrderNumber(customerOrderNumber);
|
||||
return errorLogs.Any() ? Ok(errorLogs) : NotFound();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user