diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-29 14:48:47 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-29 14:48:47 +0900 |
| commit | bfc193d8cd9aecdb82d585e8b4e101deac60a5bb (patch) | |
| tree | 8b4dac3a56cf703650c8207f9279028a8560a96b /src/server/api/endpoints/aggregation/posts.ts | |
| parent | resolve conflict (diff) | |
| download | sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.gz sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.bz2 sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.zip | |
Resolve conflicts
Diffstat (limited to 'src/server/api/endpoints/aggregation/posts.ts')
| -rw-r--r-- | src/server/api/endpoints/aggregation/posts.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/api/endpoints/aggregation/posts.ts b/src/server/api/endpoints/aggregation/posts.ts index 9d8bccbdb2..67d2619640 100644 --- a/src/server/api/endpoints/aggregation/posts.ts +++ b/src/server/api/endpoints/aggregation/posts.ts @@ -18,23 +18,23 @@ module.exports = params => new Promise(async (res, rej) => { const datas = await Post .aggregate([ { $project: { - repost_id: '$repost_id', - reply_id: '$reply_id', - created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST + repostId: '$repostId', + replyId: '$replyId', + createdAt: { $add: ['$createdAt', 9 * 60 * 60 * 1000] } // Convert into JST }}, { $project: { date: { - year: { $year: '$created_at' }, - month: { $month: '$created_at' }, - day: { $dayOfMonth: '$created_at' } + year: { $year: '$createdAt' }, + month: { $month: '$createdAt' }, + day: { $dayOfMonth: '$createdAt' } }, type: { $cond: { - if: { $ne: ['$repost_id', null] }, + if: { $ne: ['$repostId', null] }, then: 'repost', else: { $cond: { - if: { $ne: ['$reply_id', null] }, + if: { $ne: ['$replyId', null] }, then: 'reply', else: 'post' } |