From 6146a6562542719a1fd4d1e2d53b55900df8bb83 Mon Sep 17 00:00:00 2001 From: Hermann <blumh@ethz.ch> Date: Mon, 30 Jul 2018 22:18:59 +0200 Subject: [PATCH] bugfix: not all signups have a user --- src/events/viewEvent.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/events/viewEvent.js b/src/events/viewEvent.js index 0d02878..cf2f01c 100644 --- a/src/events/viewEvent.js +++ b/src/events/viewEvent.js @@ -80,8 +80,11 @@ class ParticipantsTable { // TODO list should not have hardcoded size outside of stylesheet return [ m('div', { style: { width: '9em' } }, dateFormatter(data._created)), - m('div', { style: { width: '9em' } }, data.user.lastname), - m('div', { style: { width: '9em' } }, data.user.firstname), + m( + 'div', + { style: { width: '18em' } }, + data.user ? `${data.user.firstname} ${data.user.lastname}` : '', + ), m('div', { style: { width: '9em' } }, data.email), ]; } @@ -100,8 +103,7 @@ class ParticipantsTable { tileContent: this.getItemData, titles: [ { text: 'Date of Signup', width: '9em' }, - { text: 'Name', width: '9em' }, - { text: 'First Name', width: '9em' }, + { text: 'Name', width: '18em' }, { text: 'Email', width: '9em' }, ], }), @@ -137,7 +139,7 @@ export default class viewEvent extends ItemView { setUpEmailList(showAll) { // setup where query - const where = { event: this.id }; + const where = { event: this.data._id }; if (!showAll) { // only show accepted where.accepted = true; -- GitLab