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 | |
| 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')
| -rw-r--r-- | src/server/api/api-handler.ts | 4 | ||||
| -rw-r--r-- | src/server/api/index.ts | 4 | ||||
| -rw-r--r-- | src/server/api/service/discord.ts | 2 | ||||
| -rw-r--r-- | src/server/api/service/github.ts | 2 | ||||
| -rw-r--r-- | src/server/api/service/twitter.ts | 2 |
5 files changed, 7 insertions, 7 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); diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 49500b2b4a..258e632bd8 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -3,8 +3,8 @@ */ import * as Koa from 'koa'; -import * as Router from 'koa-router'; -import * as multer from 'koa-multer'; +import * as Router from '@koa/router'; +import * as multer from '@koa/multer'; import * as bodyParser from 'koa-bodyparser'; import * as cors from '@koa/cors'; diff --git a/src/server/api/service/discord.ts b/src/server/api/service/discord.ts index d5b0fcc755..369061138c 100644 --- a/src/server/api/service/discord.ts +++ b/src/server/api/service/discord.ts @@ -1,5 +1,5 @@ import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as request from 'request'; import { OAuth2 } from 'oauth'; import config from '../../../config'; diff --git a/src/server/api/service/github.ts b/src/server/api/service/github.ts index b78459e8c3..ef5a753a1a 100644 --- a/src/server/api/service/github.ts +++ b/src/server/api/service/github.ts @@ -1,5 +1,5 @@ import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as request from 'request'; import { OAuth2 } from 'oauth'; import config from '../../../config'; diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index 5338fd2deb..cdf674bab0 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -1,5 +1,5 @@ import * as Koa from 'koa'; -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import { v4 as uuid } from 'uuid'; import autwh from 'autwh'; import redis from '../../../db/redis'; |