Update dependencies 🚀
This commit is contained in:
parent
6274f6f2f6
commit
0f27b62924
99 changed files with 446 additions and 433 deletions
|
@ -16,7 +16,7 @@ import read from '../../common/read-messaging-message';
|
|||
*/
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [recipientId, recipientIdErr] = $(params.userId).type(ID).$;
|
||||
const [recipientId, recipientIdErr] = $(params.userId).type(ID).get();
|
||||
if (recipientIdErr) return rej('invalid userId param');
|
||||
|
||||
// Fetch recipient
|
||||
|
@ -33,19 +33,19 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
|||
}
|
||||
|
||||
// Get 'markAsRead' parameter
|
||||
const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().$;
|
||||
const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().get();
|
||||
if (markAsReadErr) return rej('invalid markAsRead 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');
|
||||
|
||||
// Check if both of sinceId and untilId is specified
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue