From d764668cd72088f0dcb48f846ce3d28df3c5cf5d Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 1 Dec 2025 16:10:57 +0100 Subject: [PATCH] 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`. --- src/ReC.API/Controllers/ActionController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ReC.API/Controllers/ActionController.cs b/src/ReC.API/Controllers/ActionController.cs index e1055b7..d863a03 100644 --- a/src/ReC.API/Controllers/ActionController.cs +++ b/src/ReC.API/Controllers/ActionController.cs @@ -14,4 +14,10 @@ public class ActionController(IMediator mediator) : ControllerBase await mediator.InvokeBatchRecAction(profileId); return Accepted(); } + + public async Task CreateAction([FromBody] CreateRecActionCommand command) + { + await mediator.Send(command); + return CreatedAtAction(nameof(CreateAction), null); + } } \ No newline at end of file