diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-02 06:26:31 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-02 06:26:31 +0900 |
| commit | 423f73777cd0b8e6ef916f1ad4e6971c1e560bb7 (patch) | |
| tree | 2b2b0fbe21322467321fa744795d13a567a22a6e /src/api | |
| parent | v3925 (diff) | |
| download | sharkey-423f73777cd0b8e6ef916f1ad4e6971c1e560bb7.tar.gz sharkey-423f73777cd0b8e6ef916f1ad4e6971c1e560bb7.tar.bz2 sharkey-423f73777cd0b8e6ef916f1ad4e6971c1e560bb7.zip | |
nanka iroiro
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/endpoints/i/update.ts | 8 | ||||
| -rw-r--r-- | src/api/models/user.ts | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/api/endpoints/i/update.ts b/src/api/endpoints/i/update.ts index 43c5245044..fc12665ad6 100644 --- a/src/api/endpoints/i/update.ts +++ b/src/api/endpoints/i/update.ts @@ -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 } }); diff --git a/src/api/models/user.ts b/src/api/models/user.ts index e92f244dd0..278b949db5 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -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[]; |