chore(webui): refresh inventory when crafting/buying/gilding kitguns #2486
@ -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