dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

Callback not working ! #838

Closed maneyputha closed 5 years ago

maneyputha commented 5 years ago

Callback gives an error

node_modules/mysql/lib/protocol/Parser.js:80
        throw err; // Rethrow non-MySQL errors
        ^
TypeError: done is not a function

When the callback is used as following

createUserProcess:function(id, fName, lName, hashPassword, birthday, gender, privilege,
    contactNumber, country, dpUrl, callback){
        var newUser = { Email : id, FirstName : fName, LastName : lName, Password : hashPassword, Birthday : birthday,
            Gender : gender, Privilege : privilege, ContactNumber : contactNumber, Country : country, DpUrl : dpUrl };

        models.user.create(newUser, callback);
    },

however it works when used as following

 models.user.create(newUser, function(err, results) {
            if(err) {
                console.log(err);
            }
        });

does anybody knows how to make it work as in the first method ? Thanks