summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/drive/stream.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-24 18:13:06 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-24 18:13:06 +0900
commit7602e8f9383be37c0f7d9359f862c366b7f2fa00 (patch)
tree013dc2467b4a2e028371d4cf94f42a138d2eb4d5 /src/server/api/endpoints/drive/stream.ts
parentBetter japanese (diff)
downloadsharkey-7602e8f9383be37c0f7d9359f862c366b7f2fa00.tar.gz
sharkey-7602e8f9383be37c0f7d9359f862c366b7f2fa00.tar.bz2
sharkey-7602e8f9383be37c0f7d9359f862c366b7f2fa00.zip
cafy 5.xに移行
Diffstat (limited to 'src/server/api/endpoints/drive/stream.ts')
-rw-r--r--src/server/api/endpoints/drive/stream.ts10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/server/api/endpoints/drive/stream.ts b/src/server/api/endpoints/drive/stream.ts
index 02313aa37b..00d89582b6 100644
--- a/src/server/api/endpoints/drive/stream.ts
+++ b/src/server/api/endpoints/drive/stream.ts
@@ -1,15 +1,11 @@
/**
* Module dependencies
*/
-import $ from 'cafy';
+import $ from 'cafy'; import ID from '../../../../cafy-id';
import DriveFile, { pack } from '../../../../models/drive-file';
/**
* Get drive stream
- *
- * @param {any} params
- * @param {any} user
- * @return {Promise<any>}
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'limit' parameter
@@ -17,11 +13,11 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
if (limitErr) return rej('invalid limit param');
// Get 'sinceId' parameter
- const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$;
+ const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
if (sinceIdErr) return rej('invalid sinceId param');
// Get 'untilId' parameter
- const [untilId, untilIdErr] = $(params.untilId).optional.id().$;
+ const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
if (untilIdErr) return rej('invalid untilId param');
// Check if both of sinceId and untilId is specified