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/posts/reposts.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/posts/reposts.ts')
| -rw-r--r-- | src/server/api/endpoints/posts/reposts.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/api/endpoints/posts/reposts.ts b/src/server/api/endpoints/posts/reposts.ts index 89ab0e3d55..51af41f523 100644 --- a/src/server/api/endpoints/posts/reposts.ts +++ b/src/server/api/endpoints/posts/reposts.ts @@ -12,25 +12,25 @@ import Post, { pack } from '../../models/post'; * @return {Promise<any>} */ module.exports = (params, user) => new Promise(async (res, rej) => { - // Get 'post_id' parameter - const [postId, postIdErr] = $(params.post_id).id().$; - if (postIdErr) return rej('invalid post_id param'); + // Get 'postId' parameter + const [postId, postIdErr] = $(params.postId).id().$; + if (postIdErr) return rej('invalid postId param'); // Get 'limit' parameter const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Lookup post @@ -47,7 +47,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => { _id: -1 }; const query = { - repost_id: post._id + repostId: post._id } as any; if (sinceId) { sort._id = 1; |