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}.");