chore(webui): refresh inventory when crafting/buying/gilding kitguns (#2486)
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:
parent
ba3df4bdbc
commit
f6cb8414c1
@ -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 });
|
||||
};
|
||||
|
@ -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 });
|
||||
};
|
||||
|
@ -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)}`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user