Update cafy to 8.0.0 🚀
This commit is contained in:
parent
0c3e9dd5e0
commit
f664cf09c0
97 changed files with 294 additions and 291 deletions
|
@ -11,23 +11,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue