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:
tekh 2025-12-01 16:10:57 +01:00
parent 6208a1cf93
commit d764668cd7

View File

@ -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);
}
}