Mark host parameter of /api/users/show nullable

This commit is contained in:
Akihiko Odaki 2018-04-01 14:10:22 +09:00
parent 975dd842d8
commit edfba6eed3

View file

@ -65,7 +65,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') {