Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.loginPeran = function(req,res)
- {
- var email = req.body.email
- var sandi = req.body.sandi
- pengguna_model.find({$and: [{email:email},{sandi:sandi}]}).exec(function(err,result){
- if(err){
- return res.json({ success: false, data: err })
- }else{
- console.log(result)
- if(result.length > 0) {
- var dataHasil ={
- email:result[0].email,
- nama_lengkap:result[0].profil.nama_lengkap,
- peran:result[0].peran,
- foto:result[0].profil.foto
- }
- console.log("Data Push "+dataHasil)
- console.log("email "+email+" Dan Sandi "+sandi)
- return res.json({ success: true, data:[dataHasil]})
- }else{
- console.log("email "+email+" Dan Sandi "+sandi)
- return res.json({ success: false, data:"lier" })
- }
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment