From bb6f054777c303bae665fcc9e7a7e7ca466fc994 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 11 Apr 2022 22:43:02 +0100 Subject: [PATCH] Add parentMilestones to GPT/goals/goalID --- .../api/v1/games/_game/_playtype/targets/goals/router.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts b/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts index 0633149b9..ca6cf1753 100644 --- a/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts +++ b/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts @@ -66,6 +66,10 @@ router.get("/:goalID", ResolveGoalID, async (req, res) => { const users = await GetUsersWithIDs(goalSubs.map((e) => e.userID)); + const parentMilestones = await db.milestones.find({ + "milestoneData.goalID": goal.goalID, + }); + return res.status(200).json({ success: true, description: `Retrieved information about ${goal.name}.`, @@ -73,6 +77,7 @@ router.get("/:goalID", ResolveGoalID, async (req, res) => { goal, goalSubs, users, + parentMilestones, }, }); });