small cleanup

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