Skip to content
Snippets Groups Projects
Commit 37cb93be authored by tamaina's avatar tamaina
Browse files

revert try

parent beb451fd
No related branches found
No related tags found
No related merge requests found
......@@ -39,13 +39,7 @@ ajv.addFormat('misskey:id', /^[a-z0-9]+$/);
export default function <T extends IEndpointMeta, Ps extends Schema>(meta: T, paramDef: Ps, cb: executor<T, Ps>)
: (params: any, user: T['requireCredential'] extends true ? SimpleUserInfo : SimpleUserInfo | null, token: AccessToken | null, file?: any) => Promise<any> {
let validate: ValidateFunction<JTDDataType<Ps>>;
try {
validate = ajv.compile(paramDef);
} catch (error) {
apiLogger.error('FAILED TO COMPILE SCHEMA ' + JSON.stringify({ param: paramDef, error }));
}
const validate = ajv.compile(paramDef);
return (params: any, user: T['requireCredential'] extends true ? SimpleUserInfo : SimpleUserInfo | null, token: AccessToken | null, file?: any) => {
function cleanup() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment