Created
June 23, 2018 06:28
-
-
Save wildan3105/79a7bd61c6b323e64200a8493d62e0d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async.waterfall([ | |
function(callback){ | |
queries.getStudentByNIM(nim, function(err, std){ | |
msg = 'You are choosing ' + lecturerChosen + ' STATUS : PENDING' | |
notifLength = std.notifs.length+1 | |
callback(std[0]) | |
}) | |
}, | |
function(callback){ | |
queries.addNotif(nim, msg, notifLength, function(err){ | |
callback(null) | |
}) | |
}, | |
function(callback){ | |
queries.chooseLecturer(nim, lecturerChosen, function(err){ | |
callback(null) | |
}) | |
}, | |
function(callback){ | |
lect.getLecturerByUsername(username, function(err, lec){ | |
nLength = lec.notifs.length | |
msgLec = 'You are chosen by '+ nim | |
callback(lec[0]) | |
}) | |
}], function(err, results){ | |
if(!err) res.redirect(baseurl+'/lecturers') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment