Skip to content

Commit

Permalink
Merge pull request #45 from JAVACAFE-STUDY/develop
Browse files Browse the repository at this point in the history
0.6.0 master 반영
  • Loading branch information
rygh4775 authored Jun 25, 2019
2 parents 059cf37 + a3c8c3f commit b20efdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controllers/mail.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const transporter = nodemailer.createTransport({
*/
function sendInvitation(req, res, next) {
var invitationFrom = req.user.name;
var invitationLink = config.web.uri + '/#/invitation/' + encode(req.receiver._id, req.receiver.email);
var invitationLink = config.web.uri + '/#/invitation?token=' + encode(req.receiver._id, req.receiver.email);

ejs.renderFile(__dirname + "/../emails/invite.ejs", {
'invitationFrom': invitationFrom,
Expand Down
14 changes: 10 additions & 4 deletions models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,26 @@ UserSchema.method({

UserSchema.post('find', function(users) {
users.forEach(user => {
userAvatarPath(user);
if(user) {
userAvatarPath(user);
}
});
});

UserSchema.post('findOne', function(user) {
userAvatarPath(user);
if(user) {
userAvatarPath(user);
}
});

UserSchema.post('findById', function(user) {
userAvatarPath(user);
if(user) {
userAvatarPath(user);
}
});

function userAvatarPath(user) {
if (user.avatar != undefined) {
if (user != undefined && user.avatar != undefined) {
user.avatar = imageUrl + user.avatar;
user.thumbnail = imageUrl + user.thumbnail;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chainity-api",
"version": "0.5.1",
"version": "0.6.0",
"private": true,
"scripts": {
"start": "pm2-dev start ecosystem.config.js",
Expand Down

0 comments on commit b20efdf

Please sign in to comment.