Update setActiveQuestController.ts
This commit is contained in:
		
							parent
							
								
									9bff05a635
								
							
						
					
					
						commit
						5b6b731957
					
				@ -1,7 +1,14 @@
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
const setActiveQuestController: RequestHandler = (_req, res) => {
 | 
			
		||||
    res.sendStatus(200);
 | 
			
		||||
};
 | 
			
		||||
export const setActiveQuestController: RequestHandler<{}, {}, {}, { quest: string | undefined }> = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const quest = req.query.quest;
 | 
			
		||||
    console.log("req.query.quest", req.query.quest);
 | 
			
		||||
 | 
			
		||||
export { setActiveQuestController };
 | 
			
		||||
    const inventory = await getInventory(accountId, "ActiveQuest");
 | 
			
		||||
    inventory.ActiveQuest = quest ?? "";
 | 
			
		||||
    await inventory.save();
 | 
			
		||||
    res.status(200).end();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user