Update dependencies 🚀
This commit is contained in:
@ -11,11 +11,11 @@ import User from '../../../../models/user';
|
||||
*/
|
||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [userId, userIdErr] = $(params.userId).optional.type(ID).$;
|
||||
const [userId, userIdErr] = $(params.userId).optional.type(ID).get();
|
||||
if (userIdErr) return rej('invalid userId param');
|
||||
|
||||
// Get 'username' parameter
|
||||
const [username, usernameErr] = $(params.username).optional.string().$;
|
||||
const [username, usernameErr] = $(params.username).optional.string().get();
|
||||
if (usernameErr) return rej('invalid username param');
|
||||
|
||||
if (userId === undefined && username === undefined) {
|
||||
@ -23,7 +23,7 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
}
|
||||
|
||||
// Get 'host' parameter
|
||||
const [host, hostErr] = $(params.host).optional.string().$;
|
||||
const [host, hostErr] = $(params.host).optional.string().get();
|
||||
if (hostErr) return rej('invalid host param');
|
||||
|
||||
if (userId === undefined && host === undefined) {
|
||||
@ -31,31 +31,31 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
|
||||
}
|
||||
|
||||
// Get 'includeReplies' parameter
|
||||
const [includeReplies = true, includeRepliesErr] = $(params.includeReplies).optional.boolean().$;
|
||||
const [includeReplies = true, includeRepliesErr] = $(params.includeReplies).optional.boolean().get();
|
||||
if (includeRepliesErr) return rej('invalid includeReplies param');
|
||||
|
||||
// Get 'withMedia' parameter
|
||||
const [withMedia = false, withMediaErr] = $(params.withMedia).optional.boolean().$;
|
||||
const [withMedia = false, withMediaErr] = $(params.withMedia).optional.boolean().get();
|
||||
if (withMediaErr) return rej('invalid withMedia param');
|
||||
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
|
||||
if (limitErr) return rej('invalid limit param');
|
||||
|
||||
// Get 'sinceId' parameter
|
||||
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
|
||||
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
|
||||
if (sinceIdErr) return rej('invalid sinceId param');
|
||||
|
||||
// Get 'untilId' parameter
|
||||
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
|
||||
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
|
||||
if (untilIdErr) return rej('invalid untilId param');
|
||||
|
||||
// Get 'sinceDate' parameter
|
||||
const [sinceDate, sinceDateErr] = $(params.sinceDate).optional.number().$;
|
||||
const [sinceDate, sinceDateErr] = $(params.sinceDate).optional.number().get();
|
||||
if (sinceDateErr) throw 'invalid sinceDate param';
|
||||
|
||||
// Get 'untilDate' parameter
|
||||
const [untilDate, untilDateErr] = $(params.untilDate).optional.number().$;
|
||||
const [untilDate, untilDateErr] = $(params.untilDate).optional.number().get();
|
||||
if (untilDateErr) throw 'invalid untilDate param';
|
||||
|
||||
// Check if only one of sinceId, untilId, sinceDate, untilDate specified
|
||||
|
Reference in New Issue
Block a user