返回提交历史
Modified
src/controllers/api/updateChallengeProgressController.ts
+1
-4
Modified
src/services/inventoryService.ts
+4
-2
XFEstudio/XFESpaceNinjaServer
fix: don't use inventory projection in updateChallengeProgress (#4314)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4314 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
49afcdc3
代码差异
2 个文件
+5
-6
@@ -16,10 +16,7 @@ export const updateChallengeProgressController: RequestHandler = async (req, res
16
16
const account = await getAccountForRequest(req);
17
17
logger.debug(`challenge report:`, challenges);
18
18
19
const inventory = await getInventory(
20
account._id,
21
"ChallengesFixVersion ChallengeProgress SeasonChallengeHistory Affiliations CalendarProgress nightwaveStandingMultiplier FlavourItems"
22
);
19
const inventory = await getInventory(account._id, undefined); // Challenge completion can give any item in theory
23
20
let affiliationMods: IAffiliationMods[] = [];
24
21
const inventoryChanges: IInventoryChanges = {};
25
22
if (challenges.ChallengeProgress) {
@@ -2782,7 +2782,7 @@ export const addCalendarProgress = (inventory: TInventoryDatabaseDocument, value
2782
2782
};
2783
2783
2784
2784
export const addKahlProgress = (
2785
inventory: TInventoryDatabaseDocument,
2785
inventory: Pick<TInventoryDatabaseDocument, "Affiliations" | "MiscItems">,
2786
2786
value: IWeeklyMissionChallengeInfo[],
2787
2787
inventoryChanges: IInventoryChanges
2788
2788
): void => {
@@ -3097,7 +3097,9 @@ export const getDialogue = (
3097
3097
return dialogue;
3098
3098
};
3099
3099
3100
export const getCalendarProgress = (inventory: TInventoryDatabaseDocument): ICalendarProgress => {
3100
export const getCalendarProgress = (
3101
inventory: Pick<TInventoryDatabaseDocument, "CalendarProgress">
3102
): ICalendarProgress => {
3101
3103
const currentSeason = getWorldState().KnownCalendarSeasons[0];
3102
3104
3103
3105
if (!inventory.CalendarProgress) {