fix: give ChallengeProgress with unlockAllScans cheat (#3020)
Some checks failed
Build / build (push) Has been cancelled
Build Docker image / docker (push) Has been cancelled

Closes #3013

Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Reviewed-on: #3020
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit was merged in pull request #3020.
This commit is contained in:
2025-11-14 01:49:48 -08:00
committed by Sainan
parent 8088044ec8
commit 55e2871531

View File

@@ -3,10 +3,11 @@ import allScans from "../../../static/fixed_responses/allScans.json" with { type
import { ExportEnemies } from "warframe-public-export-plus";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { getStats } from "../../services/statsService.ts";
import { getInventory } from "../../services/inventoryService.ts";
export const unlockAllScansController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const stats = await getStats(accountId);
const [stats, inventory] = await Promise.all([getStats(accountId), getInventory(accountId, "ChallengeProgress")]);
const scanTypes = new Set<string>(allScans);
for (const type of Object.keys(ExportEnemies.avatars)) {
@@ -18,6 +19,17 @@ export const unlockAllScansController: RequestHandler = async (req, res) => {
stats.Scans.push({ type, scans: 9999 });
}
await stats.save();
const jsCodex = inventory.ChallengeProgress.find(x => x.Name === "JSCodexScan");
if (jsCodex) {
jsCodex.Progress = 1;
} else {
inventory.ChallengeProgress.push({
Name: "JSCodexScan",
Progress: 1
});
}
await Promise.all([stats.save(), inventory.save()]);
res.end();
};