Skip to content

Commit

Permalink
fix: show participant usernames in questionnaire results
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasPabloFerreira committed Sep 16, 2024
1 parent a751686 commit 2c64183
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/quest-results/quest-results.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ <h6>Nutrient Breakdown</h6>

<div class="row mb-3">
<div class="col" style="text-align: center">
{{ this.getParentUsernameById(result.userId) }}
{{ result.userType == 'parent' ? this.getParentUsernameById(result.userId) : this.getParticipantUsernameById(result.userId) }}
</div>
<div class="col" style="text-align: center">
{{ result.date }}
Expand Down
7 changes: 5 additions & 2 deletions src/app/pages/quest-results/quest-results.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ export class QuestResultsComponent implements OnInit {


export() {
// POINT
console.log(this.results, this.ffqparentList);
this.exportService.exportFFQResults(this.results, this.ffqparentList, 'FFQ_Results');

}
Expand Down Expand Up @@ -325,5 +323,10 @@ export class QuestResultsComponent implements OnInit {
getParentUsernameById(userId: string) {
return this.ffqparentList.find(parent => parent.userId === userId)?.username ?? "[not found]";
}

getParticipantUsernameById(userId: string) {
console.log(this.ffqParticipantList);
return this.ffqParticipantList.find(participant => participant.userId === userId)?.username ?? "[not found]";
}
}

0 comments on commit 2c64183

Please sign in to comment.