feat: startLibraryPersonalTarget (#873)
This commit is contained in:
		
							parent
							
								
									3a7cb5d9b1
								
							
						
					
					
						commit
						9ab0d8d15e
					
				
							
								
								
									
										14
									
								
								src/controllers/api/startLibraryPersonalTargetController.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/controllers/api/startLibraryPersonalTargetController.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const startLibraryPersonalTargetController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    inventory.LibraryPersonalTarget = req.query.target as string;
 | 
			
		||||
    await inventory.save();
 | 
			
		||||
    res.json({
 | 
			
		||||
        IsQuest: false,
 | 
			
		||||
        Target: req.query.target
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
@ -1088,6 +1088,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
			
		||||
        //Night Wave Challenge
 | 
			
		||||
        SeasonChallengeHistory: [seasonChallengeHistorySchema],
 | 
			
		||||
 | 
			
		||||
        LibraryPersonalTarget: String,
 | 
			
		||||
        //Cephalon Simaris Entries Example:"TargetType"+"Scans"(1-10)+"Completed": true|false
 | 
			
		||||
        LibraryPersonalProgress: [Schema.Types.Mixed],
 | 
			
		||||
        //Cephalon Simaris Daily Task
 | 
			
		||||
 | 
			
		||||
@ -68,6 +68,7 @@ import { setSupportedSyndicateController } from "@/src/controllers/api/setSuppor
 | 
			
		||||
import { setWeaponSkillTreeController } from "../controllers/api/setWeaponSkillTreeController";
 | 
			
		||||
import { shipDecorationsController } from "@/src/controllers/api/shipDecorationsController";
 | 
			
		||||
import { startDojoRecipeController } from "@/src/controllers/api/startDojoRecipeController";
 | 
			
		||||
import { startLibraryPersonalTargetController } from "@/src/controllers/api/startLibraryPersonalTargetController";
 | 
			
		||||
import { startRecipeController } from "@/src/controllers/api/startRecipeController";
 | 
			
		||||
import { stepSequencersController } from "@/src/controllers/api/stepSequencersController";
 | 
			
		||||
import { surveysController } from "@/src/controllers/api/surveysController";
 | 
			
		||||
@ -113,6 +114,7 @@ apiRouter.get("/setActiveQuest.php", setActiveQuestController);
 | 
			
		||||
apiRouter.get("/setActiveShip.php", setActiveShipController);
 | 
			
		||||
apiRouter.get("/setBootLocation.php", setBootLocationController);
 | 
			
		||||
apiRouter.get("/setSupportedSyndicate.php", setSupportedSyndicateController);
 | 
			
		||||
apiRouter.get("/startLibraryPersonalTarget.php", startLibraryPersonalTargetController);
 | 
			
		||||
apiRouter.get("/surveys.php", surveysController);
 | 
			
		||||
apiRouter.get("/updateSession.php", updateSessionGetController);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -350,6 +350,7 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
			
		||||
    Quests: any[];
 | 
			
		||||
    Robotics: any[];
 | 
			
		||||
    UsedDailyDeals: any[];
 | 
			
		||||
    LibraryPersonalTarget: string;
 | 
			
		||||
    LibraryPersonalProgress: ILibraryPersonalProgress[];
 | 
			
		||||
    CollectibleSeries: ICollectibleSery[];
 | 
			
		||||
    LibraryAvailableDailyTaskInfo: ILibraryAvailableDailyTaskInfo;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user