Skip to content

Commit

Permalink
feat(events): caching organizers emails. Fixes MEMB-746
Browse files Browse the repository at this point in the history
  • Loading branch information
serge1peshcoff committed Dec 30, 2019
1 parent ece5203 commit 06f2cdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ module.exports.fetchUser = async (user, token) => {
user_id: user.user_id,
comment: user.comment,
first_name: userRequest.data.first_name,
last_name: userRequest.data.last_name
last_name: userRequest.data.last_name,
email: userRequest.data.user.email
};
};

Expand Down
4 changes: 4 additions & 0 deletions models/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ const Event = sequelize.define('event', {
if (typeof organizer.comment !== 'undefined' && typeof organizer.comment !== 'string') {
throw new Error('comment is malformed.');
}

if (typeof organizer.email !== 'undefined' && typeof organizer.email !== 'string') {
throw new Error('email is malformed.');
}
}
}
}
Expand Down

0 comments on commit 06f2cdb

Please sign in to comment.