setAccountCheatController type check
This commit is contained in:
		
							parent
							
								
									32c95b6715
								
							
						
					
					
						commit
						8a78ccd68a
					
				@ -8,7 +8,7 @@ export const setAccountCheatController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
    const accountId = await getAccountIdForRequest(req);
 | 
					    const accountId = await getAccountIdForRequest(req);
 | 
				
			||||||
    const payload = req.body as ISetAccountCheatRequest;
 | 
					    const payload = req.body as ISetAccountCheatRequest;
 | 
				
			||||||
    const inventory = await getInventory(accountId, payload.key);
 | 
					    const inventory = await getInventory(accountId, payload.key);
 | 
				
			||||||
    inventory[payload.key] = payload.value;
 | 
					    inventory[payload.key] = payload.value as never;
 | 
				
			||||||
    await inventory.save();
 | 
					    await inventory.save();
 | 
				
			||||||
    res.end();
 | 
					    res.end();
 | 
				
			||||||
    if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(payload.key) != -1) {
 | 
					    if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(payload.key) != -1) {
 | 
				
			||||||
@ -18,5 +18,5 @@ export const setAccountCheatController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
interface ISetAccountCheatRequest {
 | 
					interface ISetAccountCheatRequest {
 | 
				
			||||||
    key: keyof IAccountCheats;
 | 
					    key: keyof IAccountCheats;
 | 
				
			||||||
    value: boolean;
 | 
					    value: boolean | number;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user