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

XFESpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/XFESpaceNinjaServer

fix: respect BuildLabel in queueDojoComponentDestruction (#3463)

Closes #3464 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3463 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

c1c8a502
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +5 -5
Modified src/controllers/api/queueDojoComponentDestructionController.ts +5 -5
@@ -5,15 +5,15 @@ import {
5 5 hasGuildPermission
6 6 } from "../../services/guildService.ts";
7 7 import { getInventory } from "../../services/inventoryService.ts";
8 import { getAccountIdForRequest } from "../../services/loginService.ts";
8 import { getAccountForRequest } from "../../services/loginService.ts";
9 9 import { GuildPermission } from "../../types/guildTypes.ts";
10 10 import type { RequestHandler } from "express";
11 11
12 12 export const queueDojoComponentDestructionController: RequestHandler = async (req, res) => {
13 const accountId = await getAccountIdForRequest(req);
14 const inventory = await getInventory(accountId, "GuildId LevelKeys");
13 const account = await getAccountForRequest(req);
14 const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys");
15 15 const guild = await getGuildForRequestEx(req, inventory);
16 if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, accountId, GuildPermission.Architect))) {
16 if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, account._id, GuildPermission.Architect))) {
17 17 res.json({ DojoRequestStatus: -1 });
18 18 return;
19 19 }
@@ -24,5 +24,5 @@ export const queueDojoComponentDestructionController: RequestHandler = async (re
24 24 );
25 25
26 26 await guild.save();
27 res.json(await getDojoClient(guild, 0, componentId));
27 res.json(await getDojoClient(guild, 0, componentId, account.BuildLabel));
28 28 };