diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-26 11:50:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-26 11:50:32 +0900 |
| commit | 4f9493265a769229ec0bdcf395d6a1915fc9c3be (patch) | |
| tree | 7dd9186e90b0987577be734f308b4f50f938bf0b /src/api/endpoints | |
| parent | Merge pull request #79 from syuilo/greenkeeper/pug-2.0.0-beta9 (diff) | |
| download | sharkey-4f9493265a769229ec0bdcf395d6a1915fc9c3be.tar.gz sharkey-4f9493265a769229ec0bdcf395d6a1915fc9c3be.tar.bz2 sharkey-4f9493265a769229ec0bdcf395d6a1915fc9c3be.zip | |
[API] Fix bug
Closes #76
Diffstat (limited to 'src/api/endpoints')
| -rw-r--r-- | src/api/endpoints/i/update.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/api/endpoints/i/update.js b/src/api/endpoints/i/update.js index aca2afe77e..652006e957 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 |