[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, {
fields: {
data: false 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
}, { }, {
fields: {
data: false 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
}, { }, {
fields: {
data: false 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
}, { }, {
fields: {
data: false 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, {
fields: {
data: false 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
}, { }, {
fields: {
data: false 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)
}, { }, {
fields: {
data: false data: false
}
}); });
} else { } else {
_file = deepcopy(file); _file = deepcopy(file);