返回提交历史
Modified
src/controllers/api/sellController.ts
+8
-1
Modified
src/types/sellTypes.ts
+1
-0
XFEstudio/XFESpaceNinjaServer
fix: can't dissolve arcanes (#634)
8ad979ab
代码差异
2 个文件
+9
-1
@@ -1,7 +1,7 @@
1
1
import { RequestHandler } from "express";
2
2
import { ISellRequest } from "@/src/types/sellTypes";
3
3
import { getAccountIdForRequest } from "@/src/services/loginService";
4
import { getInventory, addMods, addRecipes } from "@/src/services/inventoryService";
4
import { getInventory, addMods, addRecipes, addMiscItems } from "@/src/services/inventoryService";
5
5
6
6
export const sellController: RequestHandler = async (req, res) => {
7
7
const payload = JSON.parse(String(req.body)) as ISellRequest;
@@ -13,6 +13,13 @@ export const sellController: RequestHandler = async (req, res) => {
13
13
inventory.RegularCredits += payload.SellPrice;
14
14
} else if (payload.SellCurrency == "SC_FusionPoints") {
15
15
inventory.FusionPoints += payload.SellPrice;
16
} else if (payload.SellCurrency == "SC_DistillPoints") {
17
addMiscItems(inventory, [
18
{
19
ItemType: "/Lotus/Types/Items/MiscItems/DistillPoints",
20
ItemCount: payload.SellPrice
21
}
22
]);
16
23
} else {
17
24
throw new Error("Unknown SellCurrency: " + payload.SellCurrency);
18
25
}
@@ -12,6 +12,7 @@ export interface ISellRequest {
12
12
| "SC_RegularCredits"
13
13
| "SC_PrimeBucks"
14
14
| "SC_FusionPoints"
15
| "SC_DistillPoints"
15
16
| "SC_CrewShipFusionPoints"
16
17
| "SC_Resources";
17
18
buildLabel: string;