[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
const files = await DriveFile
.find(query, {
fields: {
data: false
}, {
},
limit: limit,
sort: sort
});

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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