backend: route save / restore

This commit is contained in:
muerwre 2018-11-30 13:49:03 +07:00
parent 032821329b
commit d932fcb287
17 changed files with 163 additions and 43 deletions

View file

@ -17,11 +17,11 @@ const UserSchema = new Schema(
first_name: { type: String },
last_name: { type: String },
photo: { type: String },
routes: [{ type: Schema.Types.ObjectId, ref: 'Route' }]
},
{
timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' }
}
);
const User = mongoose.model('User', UserSchema);
module.exports.User = User;
module.exports.UserSchema = UserSchema;