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:
parent
d6b914b9c8
commit
ac214dc8e1
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user