Add DELETE endpoint to RecActionController
A new HTTP DELETE endpoint has been added to the `RecActionController` class. The endpoint, implemented as the `GetActions` method, accepts a `profileId` as a query parameter and uses the mediator pattern to send a `DeleteRecActionsCommand` with the provided `profileId`. The method returns an HTTP 204 No Content response upon successful deletion, ensuring a clean separation of concerns and adherence to the CQRS pattern.
This commit is contained in:
parent
5b16d19541
commit
1cb9ce18b4
@ -51,4 +51,15 @@ public class RecActionController(IMediator mediator) : ControllerBase
|
||||
|
||||
return CreatedAtAction(nameof(CreateFakeAction), null);
|
||||
}
|
||||
|
||||
[HttpDelete]
|
||||
public async Task<IActionResult> GetActions([FromQuery] int profileId)
|
||||
{
|
||||
await mediator.Send(new DeleteRecActionsCommand()
|
||||
{
|
||||
ProfileId = profileId
|
||||
});
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user