diff --git a/controllers/userController.js b/controllers/userController.js index 5b5fa5e..edcacd9 100644 --- a/controllers/userController.js +++ b/controllers/userController.js @@ -4,7 +4,7 @@ const db = require("../models"); module.exports = { createUser: function(req, res) { db.User - .create({email: req.body.email}) + .create({email: req.body.email, nickName: req.body.nickName}) .then(dbModel => res.json(dbModel)) .catch(err => res.status(422).json(err)); }, diff --git a/models/user.js b/models/user.js index 9bf17f3..5e53e53 100644 --- a/models/user.js +++ b/models/user.js @@ -4,7 +4,8 @@ const Schema = mongoose.Schema; const userSchema = new Schema({ email: { type: String, required: true }, balance: {type: Number, default: 10000.00}, - investingStartDay: { type: Date, default: Date.now } + investingStartDay: { type: Date, default: Date.now }, + nickName: String }); const User = mongoose.model("User", userSchema);