nanka iroiro

This commit is contained in:
syuilo
2018-03-02 06:26:31 +09:00
parent 8c897660df
commit 423f73777c
13 changed files with 92 additions and 14 deletions

View File

@@ -46,13 +46,19 @@ module.exports = async (params, user, _, isSecure) => new Promise(async (res, re
if (bannerIdErr) return rej('invalid banner_id param');
if (bannerId) user.banner_id = bannerId;
// Get 'is_bot' parameter
const [isBot, isBotErr] = $(params.is_bot).optional.boolean().$;
if (isBotErr) return rej('invalid is_bot param');
if (isBot) user.is_bot = isBot;
await User.update(user._id, {
$set: {
name: user.name,
description: user.description,
avatar_id: user.avatar_id,
banner_id: user.banner_id,
profile: user.profile
profile: user.profile,
is_bot: user.is_bot
}
});

View File

@@ -75,6 +75,7 @@ export type IUser = {
last_used_at: Date;
latest_post: IPost;
pinned_post_id: mongo.ObjectID;
is_bot: boolean;
is_pro: boolean;
is_suspended: boolean;
keywords: string[];