File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ function createSchema(mongoose, fn) {
2121 var ObjectId = Schema . ObjectId ;
2222 var userSchema = new Schema ( {
2323 name : String ,
24- email : String ,
25- listLearnedPath :
24+ email : String ,
25+ about : String ,
26+ listLearnedPath :
2627 [
2728 {
2829 pathId : ObjectId ,
@@ -211,6 +212,15 @@ ModelProvider.prototype.findUserById = function(id, callback) {
211212 } ) ;
212213}
213214
215+ ModelProvider . prototype . findUserByName = function ( name , callback ) {
216+ this . User . findOne ( { name : name } , function ( err , res ) {
217+ if ( err )
218+ callback ( err ) ;
219+ else
220+ callback ( null , res ) ;
221+ } ) ;
222+ }
223+
214224ModelProvider . prototype . findPathById = function ( id , callback ) {
215225 this . Path . findById ( id , function ( err , tuts ) {
216226 if ( err )
You can’t perform that action at this time.
0 commit comments