fix: Result & DTOs for GetById + cleanup

This commit is contained in:
2026-03-16 21:30:58 +01:00
parent 4b99e238ca
commit 5794c3fbb5
6 changed files with 42 additions and 28 deletions

View File

@@ -29,10 +29,18 @@ public class TicketsController : ControllerBase
[HttpGet("{id}")]
public ActionResult<TicketResponse> Get(Guid id)
{
var ticket = _service.GetById(id);
var result = _service.GetById(id);
if (result is FailureResult<TicketResponse> fail)
return NotFound(fail.Error);
var success = (SuccessResult<TicketResponse>) result;
return Ok(success.Value);
/*
if (ticket == null) return NotFound();
return Ok(ticket);
*/
}
[HttpPost]