diff --git a/src/app.ts b/src/app.ts index e167b0d2..667b45cc 100644 --- a/src/app.ts +++ b/src/app.ts @@ -17,7 +17,7 @@ const app = express(); app.use(bodyParser.raw()); app.use(express.json()); -app.use(bodyParser.text()); +app.use(bodyParser.text({ limit: "4mb" })); app.use(requestLogger); app.use("/api", apiRouter); diff --git a/static/webui/script.js b/static/webui/script.js index 53d39b46..246d17d3 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1091,24 +1091,17 @@ function doAddAllMods() { modsAll.length != 0 && window.confirm("Are you sure you want to add " + modsAll.length + " mods to your account?") ) { - // Batch to avoid PayloadTooLargeError - const batches = []; - for (let i = 0; i < modsAll.length; i += 1000) { - batches.push(modsAll.slice(i, i + 1000)); - } - batches.forEach(batch => { - $.post({ - url: "/api/missionInventoryUpdate.php?" + window.authz, - contentType: "text/plain", - data: JSON.stringify({ - RawUpgrades: batch.map(mod => ({ - ItemType: mod, - ItemCount: 21 // To fully upgrade certain arcanes - })) - }) - }).done(function () { - updateInventory(); - }); + $.post({ + url: "/api/missionInventoryUpdate.php?" + window.authz, + contentType: "text/plain", + data: JSON.stringify({ + RawUpgrades: modsAll.map(mod => ({ + ItemType: mod, + ItemCount: 21 // To fully upgrade certain arcanes + })) + }) + }).done(function () { + updateInventory(); }); } });