From 078525d85d8cceebf544dc70881fed35648ceb89 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 27 Mar 2026 09:26:13 +0100 Subject: [PATCH] Refactor RecAction invoke endpoint to use profileId param Changed the HTTP POST route to accept a profileId instead of a command object, updated XML documentation accordingly, and refactored the method to construct the command internally using the provided profileId before sending it to the mediator. This improves clarity and API usability. --- src/ReC.API/Controllers/RecActionController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ReC.API/Controllers/RecActionController.cs b/src/ReC.API/Controllers/RecActionController.cs index 31751f5..6fdfcc7 100644 --- a/src/ReC.API/Controllers/RecActionController.cs +++ b/src/ReC.API/Controllers/RecActionController.cs @@ -13,14 +13,14 @@ public class RecActionController(IMediator mediator) : ControllerBase /// /// Invokes a batch of RecActions for a given profile. /// - /// The command containing the profile ID. + /// The identifier of the profile whose RecActions should be invoked. /// A token to cancel the operation. /// An HTTP 202 Accepted response indicating the process has been started. - [HttpPost("invoke/{command}")] + [HttpPost("invoke/{profileId}")] [ProducesResponseType(StatusCodes.Status202Accepted)] - public async Task Invoke([FromRoute] InvokeBatchRecActionViewsCommand command, CancellationToken cancel) + public async Task Invoke([FromRoute] long profileId, CancellationToken cancel) { - await mediator.Send(command, cancel); + await mediator.Send(new InvokeBatchRecActionViewsCommand { ProfileId = profileId }, cancel); return Accepted(); }