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:
tekh 2025-12-03 11:30:18 +01:00
parent a99f2d55b2
commit 6041d57948

View File

@ -13,10 +13,10 @@ namespace ReC.API.Controllers;
public class RecActionController(IMediator mediator) : ControllerBase
{
[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
}));
}, cancel));
[HttpPost("{profileId}")]
public async Task<IActionResult> Invoke([FromRoute] int profileId)