[API] Fix bugs

This commit is contained in:
syuilo 2017-01-18 06:21:22 +09:00
parent 3fa905dee2
commit 46e85e5cc3
7 changed files with 21 additions and 11 deletions

View File

@ -69,8 +69,9 @@ module.exports = (params, user, app) =>
// Issue query // Issue query
const files = await DriveFile const files = await DriveFile
.find(query, { .find(query, {
data: false fields: {
}, { data: false
},
limit: limit, limit: limit,
sort: sort sort: sort
}); });

View File

@ -38,7 +38,9 @@ module.exports = (params, user) =>
user_id: user._id, user_id: user._id,
folder_id: folder folder_id: folder
}, { }, {
data: false fields: {
data: false
}
}); });
// Serialize // Serialize

View File

@ -28,7 +28,9 @@ module.exports = (params, user) =>
_id: new mongo.ObjectID(fileId), _id: new mongo.ObjectID(fileId),
user_id: user._id user_id: user._id
}, { }, {
data: false fields: {
data: false
}
}); });
if (file === null) { if (file === null) {

View File

@ -31,7 +31,9 @@ module.exports = (params, user) =>
_id: new mongo.ObjectID(fileId), _id: new mongo.ObjectID(fileId),
user_id: user._id user_id: user._id
}, { }, {
data: false fields: {
data: false
}
}); });
if (file === null) { if (file === null) {

View File

@ -69,8 +69,6 @@ module.exports = (params, user, app) =>
// Issue query // Issue query
const folders = await DriveFolder const folders = await DriveFolder
.find(query, { .find(query, {
data: false
}, {
limit: limit, limit: limit,
sort: sort sort: sort
}); });

View File

@ -72,8 +72,9 @@ module.exports = (params, user) =>
// Issue query // Issue query
const files = await DriveFile const files = await DriveFile
.find(query, { .find(query, {
data: false fields: {
}, { data: false
},
limit: limit, limit: limit,
sort: sort sort: sort
}); });

View File

@ -33,13 +33,17 @@ export default (
_file = await DriveFile.findOne({ _file = await DriveFile.findOne({
_id: file _id: file
}, { }, {
data: false fields: {
data: false
}
}); });
} else if (typeof file === 'string') { } else if (typeof file === 'string') {
_file = await DriveFile.findOne({ _file = await DriveFile.findOne({
_id: new mongo.ObjectID(file) _id: new mongo.ObjectID(file)
}, { }, {
data: false fields: {
data: false
}
}); });
} else { } else {
_file = deepcopy(file); _file = deepcopy(file);