fixed ok response

This commit is contained in:
Peter 'Pita' Martischka 2011-08-04 19:22:46 +01:00
parent 9fa52c0e66
commit de0e341b4b
1 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,10 @@ exports.handle = function(functionName, fields, req, res)
// no error happend, everything is fine
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
else if(err.stop)