Add Get endpoint and refactor ReadRecActionQuery
Added a new Get endpoint to RecActionController to fetch data based on profileId using ReadRecActionQuery. Updated ReadRecActionQuery to support long ProfileId, added a parameterless constructor, and refactored its structure. Adjusted ReadRecActionQueryHandler to align with these changes.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ReC.API.Models;
|
||||
using ReC.Application.RecActions.Commands;
|
||||
using ReC.Application.RecActions.Queries;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
@@ -11,6 +12,12 @@ namespace ReC.API.Controllers;
|
||||
[ApiController]
|
||||
public class RecActionController(IMediator mediator) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Get([FromQuery] long profileId) => Ok(await mediator.Send(new ReadRecActionQuery()
|
||||
{
|
||||
ProfileId = profileId
|
||||
}));
|
||||
|
||||
[HttpPost("{profileId}")]
|
||||
public async Task<IActionResult> Invoke([FromRoute] int profileId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user