diff --git a/models/Track.js b/models/Track.js index 9876a3c..48ec539 100644 --- a/models/Track.js +++ b/models/Track.js @@ -12,7 +12,6 @@ var TrackSchema = new mongoose.Schema({ numEvents: {type: Number, default: 0}, comments: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Comment' }], author: { type: mongoose.Schema.Types.ObjectId, ref: 'User' }, -//Date;Time;Latitude;Longitude;Course;Speed;Right;Left;Confirmed;insidePrivacyArea trackData: { type: mongoose.Schema.Types.ObjectId, ref: 'TrackData' }, }, {timestamps: true}); diff --git a/models/User.js b/models/User.js index b87ecfd..a6f9d78 100644 --- a/models/User.js +++ b/models/User.js @@ -46,7 +46,8 @@ UserSchema.methods.toAuthJSON = function(){ email: this.email, token: this.generateJWT(), bio: this.bio, - image: this.image + image: this.image, + apiKey: this._id }; };