From 71065077f66662381a6d5f08ad8b345ceaf742db Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 28 Mar 2018 16:59:11 +0900 Subject: wip --- src/api/endpoints/posts/create.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/api/endpoints/posts/create.ts') diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts index b99d1fbbc1..2817374545 100644 --- a/src/api/endpoints/posts/create.ts +++ b/src/api/endpoints/posts/create.ts @@ -211,12 +211,12 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { // 直近の投稿と重複してたらエラー // TODO: 直近の投稿が一日前くらいなら重複とは見なさない - if (user.latest_post) { + if (user.latestPost) { if (deepEqual({ - text: user.latest_post.text, - reply: user.latest_post.replyId ? user.latest_post.replyId.toString() : null, - repost: user.latest_post.repostId ? user.latest_post.repostId.toString() : null, - mediaIds: (user.latest_post.mediaIds || []).map(id => id.toString()) + text: user.latestPost.text, + reply: user.latestPost.replyId ? user.latestPost.replyId.toString() : null, + repost: user.latestPost.repostId ? user.latestPost.repostId.toString() : null, + mediaIds: (user.latestPost.mediaIds || []).map(id => id.toString()) }, { text: text, reply: reply ? reply._id.toString() : null, @@ -277,7 +277,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { User.update({ _id: user._id }, { $set: { - latest_post: post + latestPost: post } }); @@ -362,7 +362,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { // Increment replies count Post.update({ _id: reply._id }, { $inc: { - replies_count: 1 + repliesCount: 1 } }); @@ -457,7 +457,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { // Update repostee status Post.update({ _id: repost._id }, { $inc: { - repost_count: 1 + repostCount: 1 } }); } -- cgit v1.2.3-freya