forked from OpenWF/SpaceNinjaServer
		
	e.g. changing syndicate pledge now takes ~6 ms instead of ~84 ms. Reviewed-on: OpenWF/SpaceNinjaServer#1211
		
			
				
	
	
		
			19 lines
		
	
	
		
			527 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			527 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { RequestHandler } from "express";
 | 
						|
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
						|
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
						|
 | 
						|
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
 | 
						|
    const accountId = await getAccountIdForRequest(req);
 | 
						|
 | 
						|
    await Inventory.updateOne(
 | 
						|
        {
 | 
						|
            accountOwnerId: accountId
 | 
						|
        },
 | 
						|
        {
 | 
						|
            SupportedSyndicate: req.query.syndicate as string
 | 
						|
        }
 | 
						|
    );
 | 
						|
 | 
						|
    res.end();
 | 
						|
};
 |