handler/APIHandler: use jshint

This commit is contained in:
booo 2011-12-22 12:26:56 +01:00
parent 1f41ef3365
commit da7098168e

View file

@ -72,7 +72,7 @@ var functions = {
exports.handle = function(functionName, fields, req, res)
{
//check the api key!
if(fields["apikey"] != apikey.trim())
if(fields.apikey != apikey.trim())
{
res.send({code: 4, message: "no or wrong API Key", data: null});
return;
@ -107,7 +107,7 @@ exports.handle = function(functionName, fields, req, res)
functionParams.push(function(err, data)
{
// no error happend, everything is fine
if(err == null)
if(!err)
{
if(!data)
data = null;
@ -129,7 +129,7 @@ exports.handle = function(functionName, fields, req, res)
//call the api function
api[functionName](functionParams[0],functionParams[1],functionParams[2],functionParams[3],functionParams[4]);
}
};
/**
* Generates a random String with the given length. Is needed to generate the Author Ids