Add CancellationToken support to Get method
The `Get` method in `RecActionController` was updated to include a `CancellationToken` parameter, enabling support for operation cancellation. The `mediator.Send` call was modified to pass the token. No changes were made to the `Invoke` method or other unrelated parts of the class.
This commit is contained in:
parent
a99f2d55b2
commit
6041d57948
@ -13,10 +13,10 @@ namespace ReC.API.Controllers;
|
|||||||
public class RecActionController(IMediator mediator) : ControllerBase
|
public class RecActionController(IMediator mediator) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IActionResult> Get([FromQuery] long profileId) => Ok(await mediator.Send(new ReadRecActionQuery()
|
public async Task<IActionResult> Get([FromQuery] long profileId, CancellationToken cancel) => Ok(await mediator.Send(new ReadRecActionQuery()
|
||||||
{
|
{
|
||||||
ProfileId = profileId
|
ProfileId = profileId
|
||||||
}));
|
}, cancel));
|
||||||
|
|
||||||
[HttpPost("{profileId}")]
|
[HttpPost("{profileId}")]
|
||||||
public async Task<IActionResult> Invoke([FromRoute] int profileId)
|
public async Task<IActionResult> Invoke([FromRoute] int profileId)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user