refactor: APIで非JSON入力の型変換はendpointに渡す前に行うように (#8229)

* Resolve #8228

* fix
This commit is contained in:
MeiMei
2022-01-31 01:40:27 +09:00
committed by GitHub
parent 943ff2dfdb
commit f2b40b51c2
3 changed files with 17 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => {
// Authentication
authenticate(body['i']).then(([user, app]) => {
// API invoking
call(endpoint.name, user, app, body, (ctx as any).file).then((res: any) => {
call(endpoint.name, user, app, body, ctx).then((res: any) => {
reply(res);
}).catch((e: ApiError) => {
reply(e.httpStatusCode ? e.httpStatusCode : e.kind === 'client' ? 400 : 500, e);