From 59ea5e3e67e21655705953c888e403c0f84abd4e Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 12 Jan 2026 13:26:54 +0100 Subject: [PATCH] Update action invocation logic and remove EndpointAuth include Changed invocation filter to use Results.Any() instead of Root.OutRes. Removed eager loading of EndpointAuth from the query. --- .../RecActions/Queries/ReadRecActionViewQuery.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ReC.Application/RecActions/Queries/ReadRecActionViewQuery.cs b/src/ReC.Application/RecActions/Queries/ReadRecActionViewQuery.cs index 45853a9..4501cd4 100644 --- a/src/ReC.Application/RecActions/Queries/ReadRecActionViewQuery.cs +++ b/src/ReC.Application/RecActions/Queries/ReadRecActionViewQuery.cs @@ -25,9 +25,11 @@ public class ReadRecActionViewQueryHandler(IRepository repo, IMap query = repo.Where(act => act.ProfileId == profileId); if (request.Invoked is bool invoked) - query = invoked ? query.Where(act => act.Root!.OutRes != null) : query.Where(act => act.Root!.OutRes == null); + query = invoked + ? query.Where(act => act.Results!.Any()) + : query.Where(act => !act.Results!.Any()); - var actions = await query.Include(act => act.EndpointAuth).ToListAsync(cancel); + var actions = await query.ToListAsync(cancel); if (actions.Count == 0) throw new NotFoundException($"No actions found for the profile {request.ProfileId}.");