From f9c0a8be55509540189ea89284f0c11a3de5cef0 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 4 Dec 2025 15:27:43 +0100 Subject: [PATCH] Refactor Get method to accept query object directly Simplified the `Get` method in `RecActionController` by replacing the `profileId` parameter with a `ReadRecActionQuery` object. This eliminates the need to manually construct the query object within the method, improving code readability and reducing redundancy. --- src/ReC.API/Controllers/RecActionController.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ReC.API/Controllers/RecActionController.cs b/src/ReC.API/Controllers/RecActionController.cs index da10cb3..543186d 100644 --- a/src/ReC.API/Controllers/RecActionController.cs +++ b/src/ReC.API/Controllers/RecActionController.cs @@ -48,10 +48,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co /// A list of RecActions for the specified profile. [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Get([FromQuery] long profileId, CancellationToken cancel) => Ok(await mediator.Send(new ReadRecActionQuery() - { - ProfileId = profileId - }, cancel)); + public async Task Get([FromQuery] ReadRecActionQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel)); /// /// Gets all RecActions for a fake/test profile.