diff --git a/src/ReC.API/Controllers/EndpointAuthController.cs b/src/ReC.API/Controllers/EndpointAuthController.cs index af767f3..daa7d1a 100644 --- a/src/ReC.API/Controllers/EndpointAuthController.cs +++ b/src/ReC.API/Controllers/EndpointAuthController.cs @@ -1,8 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Mvc; -using ReC.Application.Common.Procedures.DeleteProcedure; -using ReC.Application.Common.Procedures.InsertProcedure; -using ReC.Application.Common.Procedures.UpdateProcedure; using ReC.Application.EndpointAuth.Commands; namespace ReC.API.Controllers; @@ -21,22 +18,21 @@ public class EndpointAuthController(IMediator mediator, IConfiguration config) : [ProducesResponseType(StatusCodes.Status201Created)] public async Task Post([FromBody] InsertEndpointAuthProcedure procedure, CancellationToken cancel) { - var id = await mediator.ExecuteInsertProcedure(procedure, config["AddedWho"], cancel); + var id = await mediator.Send(procedure, cancel); return StatusCode(StatusCodes.Status201Created, id); } /// /// Updates an endpoint authentication record via the ENDPOINT_AUTH update procedure. /// - /// ENDPOINT_AUTH identifier to update. /// UpdateEndpointAuthProcedure payload. /// A token to cancel the operation. /// No content on success. - [HttpPut("{id:long}")] + [HttpPut] [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task Put([FromRoute] long id, [FromBody] UpdateEndpointAuthProcedure procedure, CancellationToken cancel) + public async Task Put([FromBody] UpdateEndpointAuthProcedure procedure, CancellationToken cancel) { - await mediator.ExecuteUpdateProcedure(procedure, id, cancel: cancel); + await mediator.Send(procedure, cancel); return NoContent(); } @@ -50,7 +46,7 @@ public class EndpointAuthController(IMediator mediator, IConfiguration config) : [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task Delete([FromBody] DeleteEndpointAuthProcedure procedure, CancellationToken cancel) { - await mediator.ExecuteDeleteProcedure(procedure, cancel); + await mediator.Send(procedure, cancel); return NoContent(); } }