Update cafy to 8.0.0 🚀
This commit is contained in:
parent
0c3e9dd5e0
commit
f664cf09c0
97 changed files with 294 additions and 291 deletions
|
@ -16,19 +16,19 @@ import { pack } from '../../../../models/note';
|
|||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'following' parameter
|
||||
const [following = false, followingError] =
|
||||
$(params.following).optional.boolean().get();
|
||||
$.bool.optional().get(params.following);
|
||||
if (followingError) return rej('invalid following param');
|
||||
|
||||
// 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) return rej('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) return rej('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) return rej('invalid untilId param');
|
||||
|
||||
// Check if both of sinceId and untilId is specified
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue