mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
refactor(rest) main.sendResponse -> sendResponse
This commit is contained in:
parent
6204c541e2
commit
b2d3fc8d85
1 changed files with 6 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue