SpaceNinjaServer/src/controllers/api/hostSessionController.ts
Sainan 2c440bde65 chore: resolve various eslint complaints
Some warnings remain, none of them particularly useful, but I've decided not to disable them.
However, I did decide to disable `@typescript-eslint/no-misused-promises` due to basically only being noise, and removed the respective comments made because of it.
2024-05-05 23:37:09 +02:00

16 lines
666 B
TypeScript

import { RequestHandler } from "express";
import { createNewSession } from "@/src/managers/sessionManager";
import { logger } from "@/src/utils/logger";
import { ISession } from "@/src/types/session";
const hostSessionController: RequestHandler = (req, res) => {
const hostSessionRequest = JSON.parse(req.body as string) as ISession;
logger.debug("HostSession Request", { hostSessionRequest });
const session = createNewSession(hostSessionRequest, req.query.accountId as string);
logger.debug(`New Session Created`, { session });
res.json({ sessionId: { $oid: session.sessionId }, rewardSeed: 99999999 });
};
export { hostSessionController };