diff --git a/config/config.js b/config/config.js index aea5316..5adf54d 100644 --- a/config/config.js +++ b/config/config.js @@ -1,6 +1,6 @@ const config = { jwtKey: 'MRePUBWaNW7wvNKMcOCkGlo6ZipKs4HKiRq2yAYV33FroszPKV0kOsnbtaIM', - databaseUrl: 'mongodb://localhost:27017/myproject' + databaseUrl: 'mongodb://localhost:27017/local' }; module.exports = config; \ No newline at end of file diff --git a/models/users.js b/models/users.js index 5d5fe7e..a0d1649 100644 --- a/models/users.js +++ b/models/users.js @@ -5,7 +5,11 @@ const path = require('path'); const UserEventSchema = require(path.resolve('models/user_event_schema')) const UserSchema = new mongoose.Schema({ - name: { + + firstName: { + type: String + }, + lastName: { type: String }, email: { @@ -15,10 +19,19 @@ const UserSchema = new mongoose.Schema({ password: { type: String }, + phoneNumber: { + type: String, + }, + city: { + type: String, + }, + country: { + type: String, + }, salt: { type: String - }, - events: [UserEventSchema] + } + }); UserSchema.pre('save', function (next) { diff --git a/routes/authentication.js b/routes/authentication.js index 6d4948f..4d7c4d9 100644 --- a/routes/authentication.js +++ b/routes/authentication.js @@ -16,9 +16,13 @@ const endpoints = [ auth: false, validate: { payload: { - name: joi.string().min(5).required(), + firstName: joi.string().min(5).required(), + lastName: joi.string().min(5).required(), email: joi.string().email().required(), - password: joi.string().required() + password: joi.string().required(), + phoneNumber: joi.string().required(), + city: joi.string().required(), + country: joi.string().required() } } },