Replace legacy checkBodyType with Zod
Start matchmaking integration Start rooms API Move existing room scene locations to roomtypes file Auth checkExpired util for client refreshing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { APIUtils, NoBody } from "../../apiutils.ts";
|
||||
import express from "express";
|
||||
import Logging from "@proxnet/undead-logging";
|
||||
import { z } from "zod";
|
||||
|
||||
const log = new Logging("PlayerReportingRoute");
|
||||
|
||||
@@ -10,11 +11,15 @@ interface HileMessage {
|
||||
Message: string;
|
||||
}
|
||||
|
||||
const HileMessageSchema = z.object({
|
||||
Message: z.string()
|
||||
});
|
||||
|
||||
route.router.post('/v1/hile',
|
||||
|
||||
APIUtils.Authentication,
|
||||
express.json(),
|
||||
APIUtils.checkBodyTypes<HileMessage>({Message: ""}),
|
||||
APIUtils.validateRequestBody(HileMessageSchema),
|
||||
|
||||
(rq: express.Request<NoBody, NoBody, HileMessage>, rs) => {
|
||||
rs.sendStatus(204);
|
||||
|
||||
Reference in New Issue
Block a user