Skip to content

Commit

Permalink
Apply participant id to the calls to check assessment
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulCooperWorkJustice committed Aug 20, 2024
1 parent acfbdfa commit 477da7c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ private async Task<bool> MustBeScored(string identifier, CancellationToken cance
{
var assessments = await _unitOfWork.DbContext.ParticipantAssessments
.Include(pa => pa.Scores)
.ToArrayAsync(cancellationToken);
.Where(pa => pa.ParticipantId == identifier)
.ToArrayAsync(cancellationToken)
;

var latest = assessments.MaxBy(a => a.Created);

Expand All @@ -106,6 +108,7 @@ private async Task<bool> MustHaveTwoReds(string identifier, CancellationToken ca
{
var assessments = await _unitOfWork.DbContext.ParticipantAssessments
.Include(pa => pa.Scores)
.Where(pa=>pa.ParticipantId == identifier)
.ToArrayAsync(cancellationToken);

var latest = assessments.MaxBy(a => a.Created);
Expand Down

0 comments on commit 477da7c

Please sign in to comment.