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.
This commit is contained in:
tekh 2025-12-04 15:27:43 +01:00
parent 77fde199e1
commit f9c0a8be55

View File

@ -48,10 +48,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co
/// <returns>A list of RecActions for the specified profile.</returns>
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Get([FromQuery] long profileId, CancellationToken cancel) => Ok(await mediator.Send(new ReadRecActionQuery()
{
ProfileId = profileId
}, cancel));
public async Task<IActionResult> Get([FromQuery] ReadRecActionQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel));
/// <summary>
/// Gets all RecActions for a fake/test profile.