summaryrefslogtreecommitdiff
path: root/src/server/api/api-handler.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-07-16 03:43:36 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-07-16 03:43:36 +0900
commit1744316656f742dddc6f314aa8bc3289714f1311 (patch)
treefa5c69840097adc70a0f2e3278c52dfacf5efbf1 /src/server/api/api-handler.ts
parent良い感じに (diff)
downloadsharkey-1744316656f742dddc6f314aa8bc3289714f1311.tar.gz
sharkey-1744316656f742dddc6f314aa8bc3289714f1311.tar.bz2
sharkey-1744316656f742dddc6f314aa8bc3289714f1311.zip
良い感じに
Diffstat (limited to 'src/server/api/api-handler.ts')
-rw-r--r--src/server/api/api-handler.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts
index 77a445e186..128c1a98d2 100644
--- a/src/server/api/api-handler.ts
+++ b/src/server/api/api-handler.ts
@@ -1,12 +1,12 @@
import * as Koa from 'koa';
-import Endpoint from './endpoint';
+import { IEndpoint } from './endpoints';
import authenticate from './authenticate';
import call from './call';
import { IUser } from '../../models/user';
import { IApp } from '../../models/app';
-export default async (endpoint: Endpoint, ctx: Koa.Context) => {
+export default async (endpoint: IEndpoint, ctx: Koa.Context) => {
const body = ctx.is('multipart/form-data') ? (ctx.req as any).body : ctx.request.body;
const reply = (x?: any, y?: any) => {
@@ -37,7 +37,7 @@ export default async (endpoint: Endpoint, ctx: Koa.Context) => {
// API invoking
try {
- res = await call(endpoint, user, app, body, (ctx.req as any).file);
+ res = await call(endpoint.name, user, app, body, (ctx.req as any).file);
} catch (e) {
reply(400, e);
return;