fixed ok response

This commit is contained in:
Peter 'Pita' Martischka 2011-08-04 19:22:46 +01:00
parent 9fa52c0e66
commit de0e341b4b

View file

@ -108,7 +108,10 @@ exports.handle = function(functionName, fields, req, res)
// no error happend, everything is fine // no error happend, everything is fine
if(err == null) if(err == null)
{ {
res.send({code: 0, message: null, data: data}); if(!data)
data = null;
res.send({code: 0, message: "ok", data: data});
} }
// parameters were wrong and the api stopped execution, pass the error // parameters were wrong and the api stopped execution, pass the error
else if(err.stop) else if(err.stop)