Skip to content

Commit

Permalink
fixed sums of yes-predictions in right piechart (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangroese authored Aug 12, 2024
1 parent 38f7f48 commit 766ab0d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ export class EditAppointmentComponent implements OnInit {

this.participationTableItems.forEach((item) => {
if (item.prediction) {
predictionCounts[item.prediction]++;
predictionCounts[item.prediction] = (predictionCounts[item.prediction] || 0) + 1;

if ([AppointmentParticipationPrediction.YES, AppointmentParticipationPrediction.PARTLY].includes(item.prediction)) {
// the count of this section is either an increase in the number of exisint participants of this section
// or, if this is the first time we see this section, the number 1 (1st participant)
sectionCounts[item.sections] = sectionCounts[item.sections] ? sectionCounts[item.sections]++ : 1;
sectionCounts[item.sections] = (sectionCounts[item.sections] || 0) + 1;
}
} else {
predictionCounts[noPredictionKey]++;
Expand Down

0 comments on commit 766ab0d

Please sign in to comment.