Merge pull request #1347 from akihikodaki/user

Mark host parameter of /api/users/show nullable
This commit is contained in:
syuilo 2018-04-01 14:11:33 +09:00 committed by GitHub
commit e0a736a25d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
if (usernameErr) return rej('invalid username param'); if (usernameErr) return rej('invalid username param');
// Get 'host' parameter // Get 'host' parameter
const [host, hostErr] = $(params.host).optional.string().$; const [host, hostErr] = $(params.host).nullable.optional.string().$;
if (hostErr) return rej('invalid host param'); if (hostErr) return rej('invalid host param');
if (userId === undefined && typeof username !== 'string') { if (userId === undefined && typeof username !== 'string') {