I am calling the following function which is in the other file. This data comes from a MySQL call. When I call this function I get "undefined value, this functions does not returning any value".
var employee_fun = require('./public/Master/manager.js');
function getJobType(param){       
    return employee_fun.getJobType(param,function(res){
        return res
    });
}
manager.js
module.exports={
    getJobType(data,callback){
        var sql="SELECT id FROM employee_types where jobtype='"+data+"'";
        mysqlcon.query(sql, function (err, result, fields) {
            callback(result[0].id);
            if (err) throw err;   
        });
    }
}
 
     
    