feat(webui): ensure forma count of at least 5 when max ranking item
All checks were successful
Build / build (18) (push) Successful in 36s
Build / build (22) (push) Successful in 33s
Build / build (20) (push) Successful in 50s
Build / build (20) (pull_request) Successful in 33s
Build / build (22) (pull_request) Successful in 49s
Build / build (18) (pull_request) Successful in 1m17s
All checks were successful
Build / build (18) (push) Successful in 36s
Build / build (22) (push) Successful in 33s
Build / build (20) (push) Successful in 50s
Build / build (20) (pull_request) Successful in 33s
Build / build (22) (pull_request) Successful in 49s
Build / build (18) (pull_request) Successful in 1m17s
This commit is contained in:
parent
241f0c894a
commit
bf02ee7e6e
@ -3,12 +3,23 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { RequestHandler } from "express";
|
||||
import { ExportMisc } from "warframe-public-export-plus";
|
||||
|
||||
export const addXpController: RequestHandler = async (req, res) => {
|
||||
const accountId = await getAccountIdForRequest(req);
|
||||
const inventory = await getInventory(accountId);
|
||||
const request = req.body as IAddXpRequest;
|
||||
for (const [category, gear] of Object.entries(request)) {
|
||||
for (const clientItem of gear) {
|
||||
const dbItem = inventory[category as TEquipmentKey].id(clientItem.ItemId.$oid);
|
||||
if (dbItem) {
|
||||
if (dbItem.ItemType in ExportMisc.uniqueLevelCaps) {
|
||||
if ((dbItem.Polarized ?? 0) < 5) {
|
||||
dbItem.Polarized = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
addGearExpByCategory(inventory, gear, category as TEquipmentKey);
|
||||
}
|
||||
await inventory.save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user