From c378e5fc946722d6e8a88bcf6a47109c31d70116 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 21 Dec 2017 02:20:02 +0900 Subject: #1021 --- src/api/endpoints/drive/files.ts | 16 ++++++++-------- src/api/endpoints/drive/folders.ts | 16 ++++++++-------- src/api/endpoints/drive/stream.ts | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/api/endpoints/drive') diff --git a/src/api/endpoints/drive/files.ts b/src/api/endpoints/drive/files.ts index b2e094775c..3d5f81339a 100644 --- a/src/api/endpoints/drive/files.ts +++ b/src/api/endpoints/drive/files.ts @@ -22,13 +22,13 @@ module.exports = async (params, user, app) => { const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; if (sinceIdErr) throw 'invalid since_id param'; - // Get 'max_id' parameter - const [maxId, maxIdErr] = $(params.max_id).optional.id().$; - if (maxIdErr) throw 'invalid max_id param'; + // Get 'until_id' parameter + const [untilId, untilIdErr] = $(params.until_id).optional.id().$; + if (untilIdErr) throw 'invalid until_id param'; - // Check if both of since_id and max_id is specified - if (sinceId && maxId) { - throw 'cannot set since_id and max_id'; + // Check if both of since_id and until_id is specified + if (sinceId && untilId) { + throw 'cannot set since_id and until_id'; } // Get 'folder_id' parameter @@ -52,9 +52,9 @@ module.exports = async (params, user, app) => { query._id = { $gt: sinceId }; - } else if (maxId) { + } else if (untilId) { query._id = { - $lt: maxId + $lt: untilId }; } if (type) { diff --git a/src/api/endpoints/drive/folders.ts b/src/api/endpoints/drive/folders.ts index d49ef0af03..7944e2c6a6 100644 --- a/src/api/endpoints/drive/folders.ts +++ b/src/api/endpoints/drive/folders.ts @@ -22,13 +22,13 @@ module.exports = (params, user, app) => 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'); } // Get 'folder_id' parameter @@ -48,9 +48,9 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => { query._id = { $gt: sinceId }; - } else if (maxId) { + } else if (untilId) { query._id = { - $lt: maxId + $lt: untilId }; } diff --git a/src/api/endpoints/drive/stream.ts b/src/api/endpoints/drive/stream.ts index 7ee255e5d1..5b0eb0a0d8 100644 --- a/src/api/endpoints/drive/stream.ts +++ b/src/api/endpoints/drive/stream.ts @@ -21,13 +21,13 @@ module.exports = (params, user) => 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'); } // Get 'type' parameter @@ -46,9 +46,9 @@ module.exports = (params, user) => new Promise(async (res, rej) => { query._id = { $gt: sinceId }; - } else if (maxId) { + } else if (untilId) { query._id = { - $lt: maxId + $lt: untilId }; } if (type) { -- cgit v1.2.3-freya