mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(rest) onFSGet: rm name
This commit is contained in:
parent
e9e4df5042
commit
9fca915d72
1 changed files with 7 additions and 9 deletions
|
|
@ -131,16 +131,15 @@
|
|||
|
||||
switch (p.request.method) {
|
||||
case 'GET':
|
||||
onFSGet(query, p.name, function(error, data, name, isFile) {
|
||||
onFSGet(query, p.name, function(error, data, isFile) {
|
||||
if (error)
|
||||
sendError(params, error);
|
||||
else if (isFile) {
|
||||
p.name = name;
|
||||
p.data = data;
|
||||
|
||||
else if (isFile)
|
||||
main.sendFile(p);
|
||||
} else
|
||||
else {
|
||||
p.name += '.json';
|
||||
sendResponse(p, data);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
|
|
@ -346,15 +345,14 @@
|
|||
func(error);
|
||||
else
|
||||
if (!isDir)
|
||||
func(null, null, null, !isDir);
|
||||
func(null, null, !isDir);
|
||||
else
|
||||
getDirContent(name, function(error, data) {
|
||||
if (!error) {
|
||||
name += '.json';
|
||||
data = Util.stringifyJSON(data);
|
||||
}
|
||||
|
||||
func(error, name, data);
|
||||
func(error, data);
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue