diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-27 05:50:34 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-27 05:50:34 +0900 |
| commit | 42a14508f6ee3a9aef374e8a8695230b3839dcb2 (patch) | |
| tree | bb177c017fe1d95796593ea9fca2e639e1035a9b /src/server/api/api-handler.ts | |
| parent | Update node version (diff) | |
| download | sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.gz sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.bz2 sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.zip | |
Update dependencies :rocket:
Diffstat (limited to 'src/server/api/api-handler.ts')
| -rw-r--r-- | src/server/api/api-handler.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts index 2de6994f32..a3be1f2aae 100644 --- a/src/server/api/api-handler.ts +++ b/src/server/api/api-handler.ts @@ -6,7 +6,7 @@ import call from './call'; import { ApiError } from './error'; export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) => { - const body = ctx.is('multipart/form-data') ? (ctx.req as any).body : ctx.request.body; + const body = ctx.request.body; const reply = (x?: any, y?: ApiError) => { if (x == null) { @@ -31,7 +31,7 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) // Authentication authenticate(body['i']).then(([user, app]) => { // API invoking - call(endpoint.name, user, app, body, (ctx.req as any).file).then((res: any) => { + call(endpoint.name, user, app, body, (ctx as any).file).then((res: any) => { reply(res); }).catch((e: ApiError) => { reply(e.httpStatusCode ? e.httpStatusCode : e.kind == 'client' ? 400 : 500, e); |