chore: simplify updateGeneric
This commit is contained in:
		
							parent
							
								
									c6c3e1c005
								
							
						
					
					
						commit
						0398691e01
					
				@ -11,7 +11,8 @@ import { IGenericUpdate } from "@/src/types/genericUpdate";
 | 
			
		||||
const genericUpdateController: RequestHandler = async (request, response) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(request);
 | 
			
		||||
    const update = getJSONfromString(String(request.body)) as IGenericUpdate;
 | 
			
		||||
    response.json(await updateGeneric(update, accountId));
 | 
			
		||||
    await updateGeneric(update, accountId);
 | 
			
		||||
    response.json(update);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export { genericUpdateController };
 | 
			
		||||
 | 
			
		||||
@ -460,7 +460,7 @@ export const updateCurrency = async (price: number, usePremium: boolean, account
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// TODO: AffiliationMods support (Nightwave).
 | 
			
		||||
export const updateGeneric = async (data: IGenericUpdate, accountId: string) => {
 | 
			
		||||
export const updateGeneric = async (data: IGenericUpdate, accountId: string): Promise<void> => {
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
 | 
			
		||||
    // Make it an array for easier parsing.
 | 
			
		||||
@ -476,8 +476,6 @@ export const updateGeneric = async (data: IGenericUpdate, accountId: string) =>
 | 
			
		||||
 | 
			
		||||
    inventory.NodeIntrosCompleted = nodes;
 | 
			
		||||
    await inventory.save();
 | 
			
		||||
 | 
			
		||||
    return data;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const updateTheme = async (data: IThemeUpdateRequest, accountId: string) => {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user