small cleanup
This commit is contained in:
+1
-3
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -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`, {
|
||||||
|
|||||||
Reference in New Issue
Block a user