Update setActiveQuestController.ts
Some checks failed
Build / build (18) (push) Failing after 38s
Build / build (20) (push) Failing after 54s
Build / build (22) (push) Failing after 1m16s

This commit is contained in:
Ordis 2025-02-07 13:13:58 +01:00
parent 9bff05a635
commit 5b6b731957

View File

@ -1,7 +1,14 @@
import { getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { RequestHandler } from "express";
const setActiveQuestController: RequestHandler = (_req, res) => {
res.sendStatus(200);
};
export const setActiveQuestController: RequestHandler<{}, {}, {}, { quest: string | undefined }> = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const quest = req.query.quest;
console.log("req.query.quest", req.query.quest);
export { setActiveQuestController };
const inventory = await getInventory(accountId, "ActiveQuest");
inventory.ActiveQuest = quest ?? "";
await inventory.save();
res.status(200).end();
};