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

chore: simplify updateGeneric

0398691e
Sainan <sainan@calamity.inc>
提交于

代码差异

2 个文件 +3 -4
Modified src/controllers/api/genericUpdateController.ts +2 -1
@@ -11,7 +11,8 @@ import { IGenericUpdate } from "@/src/types/genericUpdate";
11 11 const genericUpdateController: RequestHandler = async (request, response) => {
12 12 const accountId = await getAccountIdForRequest(request);
13 13 const update = getJSONfromString(String(request.body)) as IGenericUpdate;
14 response.json(await updateGeneric(update, accountId));
14 await updateGeneric(update, accountId);
15 response.json(update);
15 16 };
16 17
17 18 export { genericUpdateController };
Modified src/services/inventoryService.ts +1 -3
@@ -460,7 +460,7 @@ export const updateCurrency = async (price: number, usePremium: boolean, account
460 460 };
461 461
462 462 // TODO: AffiliationMods support (Nightwave).
463 export const updateGeneric = async (data: IGenericUpdate, accountId: string) => {
463 export const updateGeneric = async (data: IGenericUpdate, accountId: string): Promise<void> => {
464 464 const inventory = await getInventory(accountId);
465 465
466 466 // Make it an array for easier parsing.
@@ -476,8 +476,6 @@ export const updateGeneric = async (data: IGenericUpdate, accountId: string) =>
476 476
477 477 inventory.NodeIntrosCompleted = nodes;
478 478 await inventory.save();
479
480 return data;
481 479 };
482 480
483 481 export const updateTheme = async (data: IThemeUpdateRequest, accountId: string) => {