- Booking Event (with email to user and admin)

- Cancel Event (with email to user and admin)
- Store into mongodb
This commit is contained in:
Paolo Arena
2019-10-05 20:01:56 +02:00
parent 507f465313
commit 8f69856c57
37 changed files with 758 additions and 46 deletions

View File

@@ -42,6 +42,14 @@ var UserSchema = new mongoose.Schema({
minlength: 6,
unique: true,
},
name: {
type: String,
trim: true,
},
surname: {
type: String,
trim: true,
},
password: {
type: String,
require: true,
@@ -88,7 +96,7 @@ UserSchema.methods.toJSON = function () {
var user = this;
var userObject = user.toObject();
return _.pick(userObject, ['_id', 'email', 'verified_email', 'username', 'userId']);
return _.pick(userObject, ['_id', 'email', 'verified_email', 'username', 'userId', 'name', 'surname']);
};
UserSchema.methods.generateAuthToken = function (req) {