perf(applications): scope latest mail to filtered candidates
This commit is contained in:
@@ -538,7 +538,9 @@ Canonical profile:
|
||||
{
|
||||
// Both filters depend on rule evaluation and workflow signals that include normalized
|
||||
// note content, so evaluate before pagination to keep totals/pages correct.
|
||||
var latestMessages = await LoadLatestMessagesAsync(_db.Correspondences.AsNoTracking());
|
||||
var candidateIds = query.Select(j => j.Id);
|
||||
var latestMessages = await LoadLatestMessagesAsync(_db.Correspondences.AsNoTracking()
|
||||
.Where(message => candidateIds.Contains(message.JobApplicationId)));
|
||||
var pre = await query.ToListAsync(cancellationToken);
|
||||
var filtered = new List<JobApplication>();
|
||||
foreach (var j in pre)
|
||||
|
||||
Reference in New Issue
Block a user