diff --git a/src/ReC.API/Controllers/ActionController.cs b/src/ReC.API/Controllers/ActionController.cs index 8684d2b..8c3d496 100644 --- a/src/ReC.API/Controllers/ActionController.cs +++ b/src/ReC.API/Controllers/ActionController.cs @@ -1,6 +1,7 @@ using MediatR; using Microsoft.AspNetCore.Mvc; using ReC.Application.RecActions.Commands; +using System.IO; namespace ReC.API.Controllers; @@ -25,16 +26,21 @@ public class ActionController(IMediator mediator) : ControllerBase [HttpPost("fake")] public async Task CreateFakeAction( - string? endpointUri = null, + string endpointUri = "https://jsonplaceholder.typicode.com/posts", + string? endpointPath = null, string type = "GET", string bodyQuery = "SELECT NULL AS REQUEST_BODY;") { + if (endpointPath is not null) + endpointUri = new Uri(new Uri(endpointUri.TrimEnd('/') + "/"), endpointPath.TrimStart('/')).ToString(); + await mediator.Send(new CreateRecActionCommand() { ProfileId = 2, EndpointUri = endpointUri, Type = type, - BodyQuery = bodyQuery + BodyQuery = bodyQuery, + Active = true, }); return CreatedAtAction(nameof(CreateFakeAction), null);