diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-12-21 02:20:02 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-12-21 02:20:02 +0900 |
| commit | c378e5fc946722d6e8a88bcf6a47109c31d70116 (patch) | |
| tree | e9517af381c4638679f1434bd02c14185fec7f3f /src/api/endpoints/posts.ts | |
| parent | Update api.ja.pug (diff) | |
| download | sharkey-c378e5fc946722d6e8a88bcf6a47109c31d70116.tar.gz sharkey-c378e5fc946722d6e8a88bcf6a47109c31d70116.tar.bz2 sharkey-c378e5fc946722d6e8a88bcf6a47109c31d70116.zip | |
#1021
Diffstat (limited to 'src/api/endpoints/posts.ts')
| -rw-r--r-- | src/api/endpoints/posts.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/api/endpoints/posts.ts b/src/api/endpoints/posts.ts index f6efcc108d..db166cd67a 100644 --- a/src/api/endpoints/posts.ts +++ b/src/api/endpoints/posts.ts @@ -36,13 +36,13 @@ module.exports = (params) => new Promise(async (res, rej) => { const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; if (sinceIdErr) return rej('invalid since_id param'); - // Get 'max_id' parameter - const [maxId, maxIdErr] = $(params.max_id).optional.id().$; - if (maxIdErr) return rej('invalid max_id param'); + // Get 'until_id' parameter + const [untilId, untilIdErr] = $(params.until_id).optional.id().$; + if (untilIdErr) return rej('invalid until_id param'); - // Check if both of since_id and max_id is specified - if (sinceId && maxId) { - return rej('cannot set since_id and max_id'); + // Check if both of since_id and until_id is specified + if (sinceId && untilId) { + return rej('cannot set since_id and until_id'); } // Construct query @@ -55,9 +55,9 @@ module.exports = (params) => new Promise(async (res, rej) => { query._id = { $gt: sinceId }; - } else if (maxId) { + } else if (untilId) { query._id = { - $lt: maxId + $lt: untilId }; } |