Add CreateAction endpoint to ActionController
Introduced a new asynchronous `CreateAction` method in the `ActionController` class to handle HTTP POST requests for creating "rec actions". The method accepts a `CreateRecActionCommand` object from the request body, processes it using `mediator.Send`, and returns a `201 Created` response using `CreatedAtAction`.
This commit is contained in:
parent
6208a1cf93
commit
d764668cd7
@ -14,4 +14,10 @@ public class ActionController(IMediator mediator) : ControllerBase
|
||||
await mediator.InvokeBatchRecAction(profileId);
|
||||
return Accepted();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> CreateAction([FromBody] CreateRecActionCommand command)
|
||||
{
|
||||
await mediator.Send(command);
|
||||
return CreatedAtAction(nameof(CreateAction), null);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user