From 4f9493265a769229ec0bdcf395d6a1915fc9c3be Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 26 Jan 2017 11:50:32 +0900 Subject: [PATCH] [API] Fix bug Closes #76 --- src/api/endpoints/i/update.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/api/endpoints/i/update.js b/src/api/endpoints/i/update.js index aca2afe77..652006e95 100644 --- a/src/api/endpoints/i/update.js +++ b/src/api/endpoints/i/update.js @@ -55,11 +55,15 @@ module.exports = async (params, user, _, isSecure) => // Get 'birthday' parameter const birthday = params.birthday; if (birthday != null) { - if (!isValidBirthday(birthday)) { - return rej('invalid birthday'); - } + if (birthday != '') { + if (!isValidBirthday(birthday)) { + return rej('invalid birthday'); + } - user.birthday = birthday; + user.birthday = birthday; + } else { + user.birthday = null; + } } // Get 'avatar_id' parameter