"Fix" VaRiAbLe NaMeS
This commit is contained in:
parent
60d1853a1e
commit
ad55d2f09a
@ -3,24 +3,24 @@ import { getSession } from "@/src/managers/sessionManager";
|
|||||||
|
|
||||||
const findSessionsController: RequestHandler = (_req, res) => {
|
const findSessionsController: RequestHandler = (_req, res) => {
|
||||||
console.log("FindSession Request:", JSON.parse(_req.body));
|
console.log("FindSession Request:", JSON.parse(_req.body));
|
||||||
let r = JSON.parse(_req.body);
|
let req = JSON.parse(_req.body);
|
||||||
if (r.id != undefined) {
|
if (req.id != undefined) {
|
||||||
console.log("Found ID");
|
console.log("Found ID");
|
||||||
let s = getSession(r.id);
|
let session = getSession(req.id);
|
||||||
|
|
||||||
if (s) res.json({ queryId: r.queryId, Sessions: s });
|
if (session) res.json({ queryId: req.queryId, Sessions: session });
|
||||||
else res.json({});
|
else res.json({});
|
||||||
} else if (r.originalSessionId != undefined) {
|
} else if (req.originalSessionId != undefined) {
|
||||||
console.log("Found OriginalSessionID");
|
console.log("Found OriginalSessionID");
|
||||||
|
|
||||||
let s = getSession(r.originalSessionId);
|
let session = getSession(req.originalSessionId);
|
||||||
if (s) res.json({ queryId: r.queryId, Sessions: [s] });
|
if (session) res.json({ queryId: req.queryId, Sessions: session });
|
||||||
else res.json({});
|
else res.json({});
|
||||||
} else {
|
} else {
|
||||||
console.log("Found SessionRequest");
|
console.log("Found SessionRequest");
|
||||||
|
|
||||||
let s = getSession(_req.body);
|
let session = getSession(_req.body);
|
||||||
if (s) res.json({ queryId: r.queryId, Sessions: [s] });
|
if (session) res.json({ queryId: req.queryId, Sessions: session });
|
||||||
else res.json({});
|
else res.json({});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,9 +3,9 @@ import { getSessionByID } from "@/src/managers/sessionManager";
|
|||||||
|
|
||||||
const joinSessionController: RequestHandler = (_req, res) => {
|
const joinSessionController: RequestHandler = (_req, res) => {
|
||||||
console.log("JoinSession Request:", JSON.parse(_req.body));
|
console.log("JoinSession Request:", JSON.parse(_req.body));
|
||||||
let r = JSON.parse(_req.body);
|
let req = JSON.parse(_req.body);
|
||||||
let s = getSessionByID(r.sessionIds[0]);
|
let session = getSessionByID(req.sessionIds[0]);
|
||||||
res.json({ rewardSeed: s?.rewardSeed, sessionId: { $oid: s?.sessionId } });
|
res.json({ rewardSeed: session?.rewardSeed, sessionId: { $oid: session?.sessionId } });
|
||||||
};
|
};
|
||||||
|
|
||||||
export { joinSessionController };
|
export { joinSessionController };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user