forked from OpenWF/SpaceNinjaServer
		
	chore: fix non-string concat warnings
This commit is contained in:
		
							parent
							
								
									1c436d9466
								
							
						
					
					
						commit
						9455703bdc
					
				@ -9,7 +9,7 @@ export const focusController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    switch (req.query.op) {
 | 
			
		||||
        default:
 | 
			
		||||
            logger.error("Unhandled focus op type: " + req.query.op);
 | 
			
		||||
            logger.error("Unhandled focus op type: " + String(req.query.op));
 | 
			
		||||
            logger.debug(String(req.body));
 | 
			
		||||
            res.end();
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
@ -29,17 +29,17 @@ export const gildWeaponController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const data = getJSONfromString(String(req.body)) as IGildWeaponRequest;
 | 
			
		||||
    data.ItemId = String(req.query.ItemId);
 | 
			
		||||
    if (!modularWeaponCategory.includes(req.query.Category as WeaponTypeInternal | "Hoverboards")) {
 | 
			
		||||
        throw new Error(`Unknown modular weapon Category: ${req.query.Category}`);
 | 
			
		||||
        throw new Error(`Unknown modular weapon Category: ${String(req.query.Category)}`);
 | 
			
		||||
    }
 | 
			
		||||
    data.Category = req.query.Category as WeaponTypeInternal | "Hoverboards";
 | 
			
		||||
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    if (!inventory[data.Category]) {
 | 
			
		||||
        throw new Error(`Category ${req.query.Category} not found in inventory`);
 | 
			
		||||
        throw new Error(`Category ${String(req.query.Category)} not found in inventory`);
 | 
			
		||||
    }
 | 
			
		||||
    const weaponIndex = inventory[data.Category].findIndex(x => String(x._id) === data.ItemId);
 | 
			
		||||
    if (weaponIndex === -1) {
 | 
			
		||||
        throw new Error(`Weapon with ${data.ItemId} not found in category ${req.query.Category}`);
 | 
			
		||||
        throw new Error(`Weapon with ${data.ItemId} not found in category ${String(req.query.Category)}`);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const weapon = inventory[data.Category][weaponIndex];
 | 
			
		||||
 | 
			
		||||
@ -111,7 +111,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Error(`unhandled infestedFoundry mode: ${req.query.mode}`);
 | 
			
		||||
            throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user