mirror of
https://github.com/sim1222/misskey.git
synced 2025-08-06 08:43:56 +09:00
wip
This commit is contained in:
@ -7,15 +7,15 @@ import { ILocalUser } from '../../../../models/user';
|
||||
*/
|
||||
module.exports = async (params: any, user: ILocalUser) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional().range(1, 100).get(params.limit);
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
if (limitErr) throw 'invalid limit param';
|
||||
|
||||
// Get 'sinceId' parameter
|
||||
const [sinceId, sinceIdErr] = $.type(ID).optional().get(params.sinceId);
|
||||
const [sinceId, sinceIdErr] = $.type(ID).optional.get(params.sinceId);
|
||||
if (sinceIdErr) throw 'invalid sinceId param';
|
||||
|
||||
// Get 'untilId' parameter
|
||||
const [untilId, untilIdErr] = $.type(ID).optional().get(params.untilId);
|
||||
const [untilId, untilIdErr] = $.type(ID).optional.get(params.untilId);
|
||||
if (untilIdErr) throw 'invalid untilId param';
|
||||
|
||||
// Check if both of sinceId and untilId is specified
|
||||
@ -24,11 +24,11 @@ module.exports = async (params: any, user: ILocalUser) => {
|
||||
}
|
||||
|
||||
// Get 'folderId' parameter
|
||||
const [folderId = null, folderIdErr] = $.type(ID).optional().nullable().get(params.folderId);
|
||||
const [folderId = null, folderIdErr] = $.type(ID).optional.nullable.get(params.folderId);
|
||||
if (folderIdErr) throw 'invalid folderId param';
|
||||
|
||||
// Get 'type' parameter
|
||||
const [type, typeErr] = $.str.optional().match(/^[a-zA-Z\/\-\*]+$/).get(params.type);
|
||||
const [type, typeErr] = $.str.optional.match(/^[a-zA-Z\/\-\*]+$/).get(params.type);
|
||||
if (typeErr) throw 'invalid type param';
|
||||
|
||||
// Construct query
|
||||
|
Reference in New Issue
Block a user