Update dependencies 🚀

This commit is contained in:
syuilo
2019-09-27 05:50:34 +09:00
parent f4cb62db16
commit 42a14508f6
19 changed files with 1002 additions and 1001 deletions

View File

@ -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);