dimanche 29 mars 2015

TypeError: Cannot call method 'then' of undefined

I have the following code executing inside a controller in Sailsjs. The underlying adapter is sails-orientdb. I get the following error back


TypeError: Cannot call method 'then' of undefined


Why is this error occurring?



User.query("select id from User where username='" + req.param("userid") + "'").then(function(userData){
console.log(userData);
return userData;
}).fail(function (err) {
console.log("Handled");
});

Aucun commentaire:

Enregistrer un commentaire