diff options
Diffstat (limited to 'src/server/api/endpoints/drive/stream.ts')
| -rw-r--r-- | src/server/api/endpoints/drive/stream.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/api/endpoints/drive/stream.ts b/src/server/api/endpoints/drive/stream.ts index 515f74645a..612d922c6b 100644 --- a/src/server/api/endpoints/drive/stream.ts +++ b/src/server/api/endpoints/drive/stream.ts @@ -7,15 +7,15 @@ import { ILocalUser } from '../../../../models/user'; */ module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) => { // Get 'limit' parameter - const [limit = 10, limitErr] = $.num.optional().range(1, 100).get(params.limit); + const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit); if (limitErr) return rej('invalid limit param'); // Get 'sinceId' parameter - const [sinceId, sinceIdErr] = $.type(ID).optional().get(params.sinceId); + const [sinceId, sinceIdErr] = $.type(ID).optional.get(params.sinceId); if (sinceIdErr) return rej('invalid sinceId param'); // Get 'untilId' parameter - const [untilId, untilIdErr] = $.type(ID).optional().get(params.untilId); + const [untilId, untilIdErr] = $.type(ID).optional.get(params.untilId); if (untilIdErr) return rej('invalid untilId param'); // Check if both of sinceId and untilId is specified @@ -24,7 +24,7 @@ module.exports = (params: any, user: ILocalUser) => new Promise(async (res, rej) } // Get 'type' parameter - const [type, typeErr] = $.str.optional().match(/^[a-zA-Z\/\-\*]+$/).get(params.type); + const [type, typeErr] = $.str.optional.match(/^[a-zA-Z\/\-\*]+$/).get(params.type); if (typeErr) return rej('invalid type param'); // Construct query |