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.
This commit is contained in:
2026-01-12 13:26:54 +01:00
parent a9f2c4c2f7
commit 59ea5e3e67

View File

@@ -25,9 +25,11 @@ public class ReadRecActionViewQueryHandler(IRepository<RecActionView> 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}.");