mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-30 00:13:06 +00:00
revert try
This commit is contained in:
parent
beb451fd19
commit
37cb93be10
1 changed files with 1 additions and 7 deletions
|
@ -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>)
|
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> {
|
: (params: any, user: T['requireCredential'] extends true ? SimpleUserInfo : SimpleUserInfo | null, token: AccessToken | null, file?: any) => Promise<any> {
|
||||||
|
|
||||||
let validate: ValidateFunction<JTDDataType<Ps>>;
|
const validate = ajv.compile(paramDef);
|
||||||
|
|
||||||
try {
|
|
||||||
validate = ajv.compile(paramDef);
|
|
||||||
} catch (error) {
|
|
||||||
apiLogger.error('FAILED TO COMPILE SCHEMA ' + JSON.stringify({ param: paramDef, error }));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (params: any, user: T['requireCredential'] extends true ? SimpleUserInfo : SimpleUserInfo | null, token: AccessToken | null, file?: any) => {
|
return (params: any, user: T['requireCredential'] extends true ? SimpleUserInfo : SimpleUserInfo | null, token: AccessToken | null, file?: any) => {
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
|
Loading…
Reference in a new issue