From bb2a10db18c4a9851a27d17ba4bb5281bc3bf88a Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Feb 2017 01:37:50 +0900 Subject: [PATCH] [API] Fix bug --- src/api/endpoints/drive/files/update.js | 4 +++- src/api/endpoints/drive/folders/update.js | 4 +++- src/api/endpoints/i/update.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/api/endpoints/drive/files/update.js b/src/api/endpoints/drive/files/update.js index cc4a8af8d..aea3c32c3 100644 --- a/src/api/endpoints/drive/files/update.js +++ b/src/api/endpoints/drive/files/update.js @@ -76,7 +76,9 @@ module.exports = (params, user) => } } - DriveFile.update(file._id, file); + DriveFile.update(file._id, { + $set: file + }); // Serialize const fileObj = await serialize(file); diff --git a/src/api/endpoints/drive/folders/update.js b/src/api/endpoints/drive/folders/update.js index f9aa2998a..311721387 100644 --- a/src/api/endpoints/drive/folders/update.js +++ b/src/api/endpoints/drive/folders/update.js @@ -99,7 +99,9 @@ module.exports = (params, user) => } // Update - DriveFolder.update(folder._id, folder); + DriveFolder.update(folder._id, { + $set: folder + }); // Serialize const folderObj = await serialize(folder); diff --git a/src/api/endpoints/i/update.js b/src/api/endpoints/i/update.js index 652006e95..208ece4fa 100644 --- a/src/api/endpoints/i/update.js +++ b/src/api/endpoints/i/update.js @@ -78,7 +78,9 @@ module.exports = async (params, user, _, isSecure) => user.banner_id = new mongo.ObjectID(banner); } - await User.update(user._id, user); + await User.update(user._id, { + $set: user + }); // Serialize const iObj = await serialize(user, user, {