[]API Fix bugs

This commit is contained in:
syuilo 2017-03-06 03:50:27 +09:00
parent 6caee9f0ec
commit 79c264171d
4 changed files with 10 additions and 10 deletions

View file

@ -51,7 +51,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
if (fileIdErr) return rej('invalid file_id param');
let file = null;
if (fileId !== null) {
if (fileId !== undefined) {
file = await DriveFile.findOne({
_id: fileId,
user_id: user._id
@ -65,7 +65,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// テキストが無いかつ添付ファイルも無かったらエラー
if (text === null && file === null) {
if (text === undefined && file === null) {
return rej('text or file is required');
}