wip
This commit is contained in:
parent
d53d45f797
commit
11439afde7
54 changed files with 260 additions and 260 deletions
|
|
@ -8,15 +8,15 @@ import { getFriendIds } from '../../common/get-friends';
|
|||
*/
|
||||
module.exports = (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'iknow' parameter
|
||||
const [iknow = false, iknowErr] = $.bool.optional().get(params.iknow);
|
||||
const [iknow = false, iknowErr] = $.bool.optional.get(params.iknow);
|
||||
if (iknowErr) return rej('invalid iknow param');
|
||||
|
||||
// Get 'limit' parameter
|
||||
const [limit = 30, limitErr] = $.num.optional().range(1, 100).get(params.limit);
|
||||
const [limit = 30, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
if (limitErr) return rej('invalid limit param');
|
||||
|
||||
// Get 'cursor' parameter
|
||||
const [cursor = null, cursorErr] = $.type(ID).optional().get(params.cursor);
|
||||
const [cursor = null, cursorErr] = $.type(ID).optional.get(params.cursor);
|
||||
if (cursorErr) return rej('invalid cursor param');
|
||||
|
||||
// Construct query
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue