Mise à jour de models 'Mongo'
This commit is contained in:
@@ -12,6 +12,7 @@ var UserSchema = new mongoose.Schema({
|
||||
lastname: { type: String, required: [true, "can't be blank"] },
|
||||
phone: { type: String, required: [true, "can't be blank"] },
|
||||
licence: Number,
|
||||
poids: Number,
|
||||
image: String,
|
||||
bg_image: String,
|
||||
favorites: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Product' }],
|
||||
@@ -53,6 +54,7 @@ UserSchema.methods.toAuthJSON = function () {
|
||||
lastname: this.lastname,
|
||||
phone: this.phone,
|
||||
licence: this.licence,
|
||||
poids: this.poids,
|
||||
username: this.username,
|
||||
image: this.image || '/assets/images/users/user.jpg',
|
||||
bg_image: this.bg_image || '/assets/images/users/bg_user.jpg'
|
||||
@@ -67,6 +69,7 @@ UserSchema.methods.toJSONFor = function () {
|
||||
lastname: this.lastname,
|
||||
phone: this.phone,
|
||||
licence: this.licence,
|
||||
poids: this.poids,
|
||||
username: this.username,
|
||||
image: this.image || '/assets/images/users/user.jpg',
|
||||
bg_image: this.bg_image || '/assets/images/users/bg_user.jpg'
|
||||
@@ -80,6 +83,7 @@ UserSchema.methods.toProfileJSONFor = function (user) {
|
||||
lastname: this.lastname,
|
||||
phone: this.phone,
|
||||
licence: this.licence,
|
||||
poids: this.poids,
|
||||
username: this.username,
|
||||
image: this.image || '/assets/images/users/user.jpg',
|
||||
bg_image: this.bg_image || '/assets/images/users/bg_user.jpg',
|
||||
|
||||
Reference in New Issue
Block a user