Mise à jour de models 'Mongo'

This commit is contained in:
Julien Gautier
2024-01-11 16:52:43 +01:00
parent 6d6c422b46
commit 54524591dd
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -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',