diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-05-02 18:06:16 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-05-02 18:06:16 +0900 |
| commit | f664cf09c0860e0cf9920722532c6315fa35a8a1 (patch) | |
| tree | 119a57cf807ea105a68e14395420f8eb54ab7c5c /src/server/api/endpoints/notes/timeline.ts | |
| parent | oops (diff) | |
| download | sharkey-f664cf09c0860e0cf9920722532c6315fa35a8a1.tar.gz sharkey-f664cf09c0860e0cf9920722532c6315fa35a8a1.tar.bz2 sharkey-f664cf09c0860e0cf9920722532c6315fa35a8a1.zip | |
Update cafy to 8.0.0 :rocket:
Diffstat (limited to 'src/server/api/endpoints/notes/timeline.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/timeline.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index 222f0b795f..78786d4a16 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -13,23 +13,23 @@ import { pack } from '../../../../models/note'; */ module.exports = async (params, user, app) => { // Get 'limit' parameter - const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get(); + const [limit = 10, limitErr] = $.num.optional().range(1, 100).get(params.limit); if (limitErr) throw 'invalid limit param'; // Get 'sinceId' parameter - const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get(); + const [sinceId, sinceIdErr] = $.type(ID).optional().get(params.sinceId); if (sinceIdErr) throw 'invalid sinceId param'; // Get 'untilId' parameter - const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get(); + const [untilId, untilIdErr] = $.type(ID).optional().get(params.untilId); if (untilIdErr) throw 'invalid untilId param'; // Get 'sinceDate' parameter - const [sinceDate, sinceDateErr] = $(params.sinceDate).optional.number().get(); + const [sinceDate, sinceDateErr] = $.num.optional().get(params.sinceDate); if (sinceDateErr) throw 'invalid sinceDate param'; // Get 'untilDate' parameter - const [untilDate, untilDateErr] = $(params.untilDate).optional.number().get(); + const [untilDate, untilDateErr] = $.num.optional().get(params.untilDate); if (untilDateErr) throw 'invalid untilDate param'; // Check if only one of sinceId, untilId, sinceDate, untilDate specified @@ -38,11 +38,11 @@ module.exports = async (params, user, app) => { } // Get 'includeMyRenotes' parameter - const [includeMyRenotes = true, includeMyRenotesErr] = $(params.includeMyRenotes).optional.boolean().get(); + const [includeMyRenotes = true, includeMyRenotesErr] = $.bool.optional().get(params.includeMyRenotes); if (includeMyRenotesErr) throw 'invalid includeMyRenotes param'; // Get 'includeRenotedMyNotes' parameter - const [includeRenotedMyNotes = true, includeRenotedMyNotesErr] = $(params.includeRenotedMyNotes).optional.boolean().get(); + const [includeRenotedMyNotes = true, includeRenotedMyNotesErr] = $.bool.optional().get(params.includeRenotedMyNotes); if (includeRenotedMyNotesErr) throw 'invalid includeRenotedMyNotes param'; const [followings, watchingChannelIds, mutedUserIds] = await Promise.all([ |