diff --git a/src/controllers/api/startLibraryPersonalTargetController.ts b/src/controllers/api/startLibraryPersonalTargetController.ts new file mode 100644 index 00000000..388dc897 --- /dev/null +++ b/src/controllers/api/startLibraryPersonalTargetController.ts @@ -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 + }); +}; diff --git a/src/models/inventoryModels/inventoryModel.ts b/src/models/inventoryModels/inventoryModel.ts index 2bb888d2..aabf17d0 100644 --- a/src/models/inventoryModels/inventoryModel.ts +++ b/src/models/inventoryModels/inventoryModel.ts @@ -1069,6 +1069,7 @@ const inventorySchema = new Schema( //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 diff --git a/src/routes/api.ts b/src/routes/api.ts index f22b475f..909d7f0e 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -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); diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index b80134be..eed14f44 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -344,6 +344,7 @@ export interface IInventoryClient extends IDailyAffiliations { Quests: any[]; Robotics: any[]; UsedDailyDeals: any[]; + LibraryPersonalTarget: string; LibraryPersonalProgress: ILibraryPersonalProgress[]; CollectibleSeries: ICollectibleSery[]; LibraryAvailableDailyTaskInfo: ILibraryAvailableDailyTaskInfo;