summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts/create.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-28 16:59:11 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-28 16:59:11 +0900
commit71065077f66662381a6d5f08ad8b345ceaf742db (patch)
treeb24eaf45f8738f1765f9baa53c42c8a8ca9d94c6 /src/api/endpoints/posts/create.ts
parentwip (diff)
downloadsharkey-71065077f66662381a6d5f08ad8b345ceaf742db.tar.gz
sharkey-71065077f66662381a6d5f08ad8b345ceaf742db.tar.bz2
sharkey-71065077f66662381a6d5f08ad8b345ceaf742db.zip
wip
Diffstat (limited to 'src/api/endpoints/posts/create.ts')
-rw-r--r--src/api/endpoints/posts/create.ts16
1 files changed, 8 insertions, 8 deletions
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
}
});
}