From 6026ef6d71d2b2d7792b95fd53e9e767657ac337 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Feb 2017 02:20:47 +0900 Subject: [PATCH] [API] Fix bug --- src/api/endpoints/drive/files/update.js | 5 ++++- src/api/endpoints/drive/folders/update.js | 5 ++++- src/api/endpoints/i/update.js | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/api/endpoints/drive/files/update.js b/src/api/endpoints/drive/files/update.js index aea3c32c3..3ec9e5a73 100644 --- a/src/api/endpoints/drive/files/update.js +++ b/src/api/endpoints/drive/files/update.js @@ -77,7 +77,10 @@ module.exports = (params, user) => } DriveFile.update(file._id, { - $set: file + $set: { + name: file.name, + folder_id: file.folder_id + } }); // Serialize diff --git a/src/api/endpoints/drive/folders/update.js b/src/api/endpoints/drive/folders/update.js index 311721387..d04173158 100644 --- a/src/api/endpoints/drive/folders/update.js +++ b/src/api/endpoints/drive/folders/update.js @@ -100,7 +100,10 @@ module.exports = (params, user) => // Update DriveFolder.update(folder._id, { - $set: folder + $set: { + name: folder.name, + parent_id: folder.parent_id + } }); // Serialize diff --git a/src/api/endpoints/i/update.js b/src/api/endpoints/i/update.js index 208ece4fa..13b5c523e 100644 --- a/src/api/endpoints/i/update.js +++ b/src/api/endpoints/i/update.js @@ -79,7 +79,14 @@ module.exports = async (params, user, _, isSecure) => } await User.update(user._id, { - $set: user + $set: { + name: user.name, + location: user.location, + bio: user.bio, + birthday: user.birthday, + avatar_id: user.avatar_id, + banner_id: user.banner_id + } }); // Serialize