From: chapel Date: Mon, 14 Nov 2011 23:44:11 +0000 (-0800) Subject: fix merge conflict X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=516e1abc44f72d556e22b66b8b292e4a83e16518;p=oweals%2Ffinalsclub.git fix merge conflict --- 516e1abc44f72d556e22b66b8b292e4a83e16518 diff --cc app.js index bda6793,cb332c3..c94efae --- a/app.js +++ b/app.js @@@ -1633,12 -1632,13 +1633,13 @@@ app.get( '/archive/course/:id', checkAj }) app.get( '/archive/note/:id', checkAjax, loadUser, function( req, res ) { + console.log( "id="+req.params.id) ArchivedNote.findById(req.params.id, function(err, note) { - if ( err ) { - sendJson(res, {status: 'error', message: 'This is not a valid id for a note', err:err } ); + if ( err || !note ) { + sendJson(res, {status: 'error', message: 'This is not a valid id for a note'} ); } else { ArchivedCourse.findOne({id: note.course_id}, function(err, course) { - if ( err ) { + if ( err || !course ) { sendJson(res, {status: 'error', message: 'There is no course for this note'} ) } else { sendJson(res, { 'layout' : 'notesLayout', 'note' : note, 'course': course, 'user': req.user.sanitized } );