From 0be7cfbfa354bf72d0cd936a777b30591594b1f4 Mon Sep 17 00:00:00 2001 From: nyaoouo <64143453+nyaoouo@users.noreply.github.com> Date: Tue, 10 Jun 2025 02:38:52 +0800 Subject: [PATCH] Run lint --- .../api/syndicateSacrificeController.ts | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/controllers/api/syndicateSacrificeController.ts b/src/controllers/api/syndicateSacrificeController.ts index 8c097953..ac362e39 100644 --- a/src/controllers/api/syndicateSacrificeController.ts +++ b/src/controllers/api/syndicateSacrificeController.ts @@ -37,7 +37,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp reward?: { type: string; count?: number; // default 1 - } + }; } const needProcess: _HandleItem[] = []; @@ -45,7 +45,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp if (!syndicate.Initiated) { needProcess.push({ sacrifice: manifest.initiationSacrifice, - reward: manifest.initiationReward ? { type: manifest.initiationReward } : undefined, + reward: manifest.initiationReward ? { type: manifest.initiationReward } : undefined }); syndicate.Initiated = true; } @@ -55,21 +55,23 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp newLevel = res.Level = data.SacrificeLevel; res.LevelIncrease = data.SacrificeLevel - oldLevel; } else { - titles.filter(x => x.level > oldLevel && x.minStanding <= currentStanding).forEach(x => { - if (x.level > newLevel) newLevel = x.level; - const item: _HandleItem = {}; - if (x.sacrifice) { - item.sacrifice = x.sacrifice; - } - if (x.storeItemReward) { - item.reward = { type: x.storeItemReward, count: 1 }; - } else if (x.reward) { - item.reward = { type: toStoreItem(x.reward.ItemType), count: x.reward.ItemCount }; - } - if (item.sacrifice || item.reward) { - needProcess.push(item); - } - }) + titles + .filter(x => x.level > oldLevel && x.minStanding <= currentStanding) + .forEach(x => { + if (x.level > newLevel) newLevel = x.level; + const item: _HandleItem = {}; + if (x.sacrifice) { + item.sacrifice = x.sacrifice; + } + if (x.storeItemReward) { + item.reward = { type: x.storeItemReward, count: 1 }; + } else if (x.reward) { + item.reward = { type: toStoreItem(x.reward.ItemType), count: x.reward.ItemCount }; + } + if (item.sacrifice || item.reward) { + needProcess.push(item); + } + }); res.Level = newLevel; res.LevelIncrease = newLevel - oldLevel; } @@ -102,12 +104,14 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp if (isNightwave) { res.NewEpisodeReward = needProcess.length > 0; } else { - manifest.favours.filter(x => x.rankUpReward && x.requiredLevel <= newLevel).forEach(x => { - syndicate.FreeFavorsEarned ??= []; - if (!syndicate.FreeFavorsEarned.includes(x.requiredLevel)) { - syndicate.FreeFavorsEarned.push(x.requiredLevel); - } - }) + manifest.favours + .filter(x => x.rankUpReward && x.requiredLevel <= newLevel) + .forEach(x => { + syndicate.FreeFavorsEarned ??= []; + if (!syndicate.FreeFavorsEarned.includes(x.requiredLevel)) { + syndicate.FreeFavorsEarned.push(x.requiredLevel); + } + }); } syndicate.Title = newLevel; await inventory.save();