chore(webui): refresh inventory when crafting/buying/gilding kitguns (#2486)
All checks were successful
Build Docker image / docker-arm64 (push) Successful in 57s
Build Docker image / docker-amd64 (push) Successful in 1m7s
Build / build (push) Successful in 1m22s

Reviewed-on: #2486
Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com>
Co-authored-by: Animan8000 <animan8000@noreply.localhost>
Co-committed-by: Animan8000 <animan8000@noreply.localhost>
This commit is contained in:
Animan8000 2025-07-13 21:08:34 -07:00 committed by Sainan
parent ba3df4bdbc
commit f6cb8414c1
3 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import { RequestHandler } from "express";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { sendWsBroadcastTo } from "@/src/services/wsService";
import { getJSONfromString } from "@/src/helpers/stringHelpers";
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
@ -73,4 +74,5 @@ export const gildWeaponController: RequestHandler = async (req, res) => {
InventoryChanges: inventoryChanges,
AffiliationMods: affiliationMods
});
sendWsBroadcastTo(accountId, { update_inventory: true });
};

View File

@ -1,5 +1,6 @@
import { RequestHandler } from "express";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { sendWsBroadcastTo } from "@/src/services/wsService";
import { getJSONfromString } from "@/src/helpers/stringHelpers";
import {
getInventory,
@ -194,4 +195,5 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
MiscItems: miscItemChanges
}
});
sendWsBroadcastTo(accountId, { update_inventory: true });
};

View File

@ -15,6 +15,7 @@ import {
} from "@/src/services/inventoryService";
import { getDefaultUpgrades } from "@/src/services/itemDataService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { sendWsBroadcastTo } from "@/src/services/wsService";
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
import { IInventoryChanges } from "@/src/types/purchaseTypes";
import { EquipmentFeatures } from "@/src/types/equipmentTypes";
@ -68,6 +69,7 @@ export const modularWeaponSaleController: RequestHandler = async (req, res) => {
res.json({
InventoryChanges: inventoryChanges
});
sendWsBroadcastTo(accountId, { update_inventory: true });
} else {
throw new Error(`unknown modularWeaponSale op: ${String(req.query.op)}`);
}