Add CreateAction POST endpoint to ActionController

A new HTTP POST endpoint `CreateAction` was added to the
`ActionController` class. This endpoint accepts a
`CreateRecActionCommand` object from the request body, sends
it to the `mediator` for processing, and returns a `201 Created`
response using the `CreatedAtAction` method. This change
enables the creation of actions via HTTP POST requests,
enhancing the controller's functionality.
This commit is contained in:
tekh 2025-12-01 16:16:35 +01:00
parent d6b914b9c8
commit ac214dc8e1

View File

@ -15,6 +15,7 @@ public class ActionController(IMediator mediator) : ControllerBase
return Accepted(); return Accepted();
} }
[HttpPost]
public async Task<IActionResult> CreateAction([FromBody] CreateRecActionCommand command) public async Task<IActionResult> CreateAction([FromBody] CreateRecActionCommand command)
{ {
await mediator.Send(command); await mediator.Send(command);