From 71411d40274532a57b5d1ec529de637332a991a1 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 12 Dec 2025 01:43:01 +0100 Subject: [PATCH] Update InvokeRecActionCommand to return success status Changed InvokeRecActionCommand and its handler to return a boolean indicating success or failure, allowing consumers to check if the action was successful. This improves clarity and error handling in command execution. --- .../RecActions/Commands/InvokeRecActionCommand.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs index 98b9b06..43b8967 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs @@ -8,7 +8,7 @@ using System.Text.Json; namespace ReC.Application.RecActions.Commands; -public record InvokeRecActionCommand : IRequest +public record InvokeRecActionCommand : IRequest { public RecActionDto Action { get; set; } = null!; } @@ -22,9 +22,9 @@ public class InvokeRecActionCommandHandler( ISender sender, IHttpClientFactory clientFactory, IConfiguration? config = null - ) : IRequestHandler + ) : IRequestHandler { - public async Task Handle(InvokeRecActionCommand request, CancellationToken cancel) + public async Task Handle(InvokeRecActionCommand request, CancellationToken cancel) { var action = request.Action; using var http = clientFactory.CreateClient(); @@ -64,5 +64,7 @@ public class InvokeRecActionCommandHandler( Body = resBody, AddedWho = config?["AddedWho"] }, cancel); + + return response.IsSuccessStatusCode; } } \ No newline at end of file