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:
parent
77fde199e1
commit
f9c0a8be55
@ -48,10 +48,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co
|
|||||||
/// <returns>A list of RecActions for the specified profile.</returns>
|
/// <returns>A list of RecActions for the specified profile.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public async Task<IActionResult> Get([FromQuery] long profileId, CancellationToken cancel) => Ok(await mediator.Send(new ReadRecActionQuery()
|
public async Task<IActionResult> Get([FromQuery] ReadRecActionQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel));
|
||||||
{
|
|
||||||
ProfileId = profileId
|
|
||||||
}, cancel));
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all RecActions for a fake/test profile.
|
/// Gets all RecActions for a fake/test profile.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user