From cb0d237b6a70ad118d3511930ef6cb1bca91cd76 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 5 Mar 2018 08:07:09 +0900 Subject: #1183 --- src/api/endpoints/i/update.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/api/endpoints/i/update.ts') diff --git a/src/api/endpoints/i/update.ts b/src/api/endpoints/i/update.ts index 2a5dce64a8..76bad2d156 100644 --- a/src/api/endpoints/i/update.ts +++ b/src/api/endpoints/i/update.ts @@ -51,6 +51,11 @@ module.exports = async (params, user, _, isSecure) => new Promise(async (res, re if (isBotErr) return rej('invalid is_bot param'); if (isBot != null) user.is_bot = isBot; + // Get 'auto_watch' parameter + const [autoWatch, autoWatchErr] = $(params.auto_watch).optional.boolean().$; + if (autoWatchErr) return rej('invalid auto_watch param'); + if (autoWatch != null) user.settings.auto_watch = autoWatch; + await User.update(user._id, { $set: { name: user.name, @@ -58,7 +63,8 @@ module.exports = async (params, user, _, isSecure) => new Promise(async (res, re avatar_id: user.avatar_id, banner_id: user.banner_id, profile: user.profile, - is_bot: user.is_bot + is_bot: user.is_bot, + settings: user.settings } }); -- cgit v1.2.3-freya