using Microsoft.AspNetCore.Mvc; using Nexus.Api.Services; namespace Nexus.Api.Controllers; [ApiController] [Route("api/v1/incidents")] public class IncidentsController(IIncidentService incidentService) : ControllerBase { [HttpGet] public async Task GetAll() => Results.Ok(await incidentService.GetAllAsync()); [HttpGet("{name}")] public async Task GetOne(string name) { var incident = await incidentService.GetByNameAsync(name); return incident is null ? Results.NotFound() : Results.Ok(incident); } }