XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

fix: setting active quest (#921)

fixes #920 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/921 Co-authored-by: Ordis <134585663+OrdisPrime@users.noreply.github.com> Co-committed-by: Ordis <134585663+OrdisPrime@users.noreply.github.com>

9539bcf8
Ordis <134585663+OrdisPrime@users.noreply.github.com>
提交于

代码差异

1 个文件 +18 -4
Modified src/controllers/api/setActiveQuestController.ts +18 -4
@@ -1,7 +1,21 @@
1 import { getInventory } from "@/src/services/inventoryService";
2 import { getAccountIdForRequest } from "@/src/services/loginService";
1 3 import { RequestHandler } from "express";
2 4
3 const setActiveQuestController: RequestHandler = (_req, res) => {
4 res.sendStatus(200);
5 };
5 export const setActiveQuestController: RequestHandler<
6 Record<string, never>,
7 undefined,
8 undefined,
9 { quest: string | undefined }
10 > = async (req, res) => {
11 console.log("req params", JSON.stringify(req.params, null, 2));
12 console.log("req query", JSON.stringify(req.query, null, 2));
13 console.log("req body", JSON.stringify(req.body, null, 2));
14 const accountId = await getAccountIdForRequest(req);
15 const quest = req.query.quest;
6 16
7 export { setActiveQuestController };
17 const inventory = await getInventory(accountId, "ActiveQuest");
18 inventory.ActiveQuest = quest ?? "";
19 await inventory.save();
20 res.status(200).end();
21 };