mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(rest) onPUT cp: rm callback
This commit is contained in:
parent
b3d9092499
commit
a7fe59f363
1 changed files with 7 additions and 8 deletions
|
|
@ -276,17 +276,16 @@
|
|||
break;
|
||||
|
||||
case 'cp':
|
||||
callback = function(error) {
|
||||
checkSendError(error, pParams, function() {
|
||||
sendMsg(pParams, 'copy', lFiles.to);
|
||||
});
|
||||
};
|
||||
|
||||
if (!Util.checkObjTrue(lFiles, ['from', 'to']))
|
||||
sendError(pParams, p.data);
|
||||
else
|
||||
fse.copy(lFiles.from, lFiles.to, callback);
|
||||
|
||||
fse.copy(lFiles.from, lFiles.to, function(error) {
|
||||
console.log('#', error);
|
||||
if (error)
|
||||
sendError(pParams, error);
|
||||
else
|
||||
sendMsg(pParams, 'copy', lFiles.to);
|
||||
});
|
||||
break;
|
||||
|
||||
case 'zip':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue