refactor(rest) main.sendResponse -> sendResponse

This commit is contained in:
coderaiser 2013-11-07 09:39:14 +00:00
parent 6204c541e2
commit b2d3fc8d85

View file

@ -23,6 +23,7 @@
JSONDIR = main.JSONDIR,
OK = 200,
sendError = main.sendError,
sendResponse= main.sendResponse,
Header = main.generateHeaders({
name:'api.json'
});
@ -112,7 +113,7 @@
sendError(p, pErr);
else {
lSize = CloudFunc.getShortSize(pSize);
main.sendResponse(p, lSize);
sendResponse(p, lSize);
}
});
@ -130,7 +131,7 @@
else {
p.name += '.json';
p.data = Util.stringifyJSON(pData);
main.sendResponse(p);
sendResponse(p);
}
});
});
@ -298,7 +299,7 @@
main.child_process.exec(p.body, function(pError, pStdout, pStderr) {
var lError = pError || pStderr;
if (!lError)
main.sendResponse(pParams, pStdout);
sendResponse(pParams, pStdout);
else
sendError(pParams, lError);
});
@ -308,7 +309,7 @@
if( Util.checkObjTrue(lFiles, ['from', 'to']) )
fs.rename(lFiles.from, lFiles.to, function(pError) {
if(!pError)
main.sendResponse(pParams);
sendResponse(pParams);
else
sendError(pParams, pError);
});
@ -399,7 +400,7 @@
function sendMsg(pParams, pMsg, pName) {
var msg = CloudFunc.formatMsg(pMsg, pName);
main.sendResponse(pParams, msg);
sendResponse(pParams, msg);
}
})();