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:
@@ -25,9 +25,11 @@ public class ReadRecActionViewQueryHandler(IRepository<RecActionView> repo, IMap
|
|||||||
query = repo.Where(act => act.ProfileId == profileId);
|
query = repo.Where(act => act.ProfileId == profileId);
|
||||||
|
|
||||||
if (request.Invoked is bool invoked)
|
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)
|
if (actions.Count == 0)
|
||||||
throw new NotFoundException($"No actions found for the profile {request.ProfileId}.");
|
throw new NotFoundException($"No actions found for the profile {request.ProfileId}.");
|
||||||
|
|||||||
Reference in New Issue
Block a user