small cleanup
This commit is contained in:
+1
-3
@@ -36,9 +36,7 @@
|
||||
"scripts": {
|
||||
"build": "npm run generate && npx tsc",
|
||||
"startServer": "node out/serverMain.js",
|
||||
"startClient": "node out/clientMain.js",
|
||||
"startWebsocket": "node out/websocket.js",
|
||||
"documentation": "redocly build-docs .\\docs\\v2.yml --output=docs\\index.html",
|
||||
"documentation": "redocly build-docs .\\docs\\v3.yml --output=docs\\index.html",
|
||||
"test": "jest --runInBand",
|
||||
"generate": "npx typia generate --input src/templates --output src/generated --project tsconfig.json"
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import db, { /* createKillRecord, */ checkServerToken } from "../db";
|
||||
import { validateErrors } from "../common";
|
||||
import { KillData, MatchData, validateBody } from "../types";
|
||||
import typia, { validate } from "typia";
|
||||
import typia from "typia";
|
||||
|
||||
const router = Router();
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ export type KillData = {
|
||||
cause_of_death: string;
|
||||
};
|
||||
|
||||
type RequestBody<T> = Request<{}, {}, T>;
|
||||
|
||||
export const validateBody =
|
||||
<T>(checker: (input: T) => typia.IValidation<T>): RequestHandler =>
|
||||
(req, res, next) => {
|
||||
|
||||
@@ -167,7 +167,6 @@ describe('server', () => {
|
||||
expect(response.status).toBe(201)
|
||||
})
|
||||
|
||||
|
||||
test('register a kill with missing data', async () => {
|
||||
const data = testKill
|
||||
const response = await fetch(`http://127.0.0.1:3001/kill`, {
|
||||
|
||||
Reference in New Issue
Block a user