diff --git a/src/ReC.API/Controllers/ActionController.cs b/src/ReC.API/Controllers/ActionController.cs index 9a54481..8684d2b 100644 --- a/src/ReC.API/Controllers/ActionController.cs +++ b/src/ReC.API/Controllers/ActionController.cs @@ -19,6 +19,24 @@ public class ActionController(IMediator mediator) : ControllerBase public async Task CreateAction([FromBody] CreateRecActionCommand command) { await mediator.Send(command); + return CreatedAtAction(nameof(CreateAction), null); } + + [HttpPost("fake")] + public async Task CreateFakeAction( + string? endpointUri = null, + string type = "GET", + string bodyQuery = "SELECT NULL AS REQUEST_BODY;") + { + await mediator.Send(new CreateRecActionCommand() + { + ProfileId = 2, + EndpointUri = endpointUri, + Type = type, + BodyQuery = bodyQuery + }); + + return CreatedAtAction(nameof(CreateFakeAction), null); + } } \ No newline at end of file diff --git a/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs index 46bc918..c074fae 100644 --- a/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs @@ -6,7 +6,7 @@ namespace ReC.Application.RecActions.Commands; public record CreateRecActionCommand : IRequest { - public long ProfileId { get; init; } = 2; + public long ProfileId { get; init; } public bool Active { get; init; } = true; @@ -14,11 +14,11 @@ public record CreateRecActionCommand : IRequest public string? EndpointUri { get; init; } - public string Type { get; init; } = "GET"; + public string Type { get; init; } = null!; public string? HeaderQuery { get; init; } - public string BodyQuery { get; init; } = "SELECT NULL AS REQUEST_BODY;"; + public string BodyQuery { get; init; } = null!; } public class CreateRecActionCommandHandler(ISender sender) : IRequestHandler