From 7cc48c94cee307852cba25e51551f4cf841bde90 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sat, 26 Mar 2022 23:37:58 +0000 Subject: [PATCH] Move GPT/goals to GPT/targets/goals --- .../server/router/api/v1/games/_game/_playtype/router.ts | 2 +- .../games/_game/_playtype/{ => targets}/goals/router.ts | 6 +++--- .../router/api/v1/games/_game/_playtype/targets/router.ts | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) rename server/src/server/router/api/v1/games/_game/_playtype/{ => targets}/goals/router.ts (95%) create mode 100644 server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts diff --git a/server/src/server/router/api/v1/games/_game/_playtype/router.ts b/server/src/server/router/api/v1/games/_game/_playtype/router.ts index 66faddce5..8ddc5da4e 100644 --- a/server/src/server/router/api/v1/games/_game/_playtype/router.ts +++ b/server/src/server/router/api/v1/games/_game/_playtype/router.ts @@ -18,7 +18,7 @@ import { import { GetUsersWithIDs } from "utils/user"; import chartsRouter from "./charts/router"; import foldersRouter from "./folders/router"; -import goalsRouter from "./goals/router"; +import goalsRouter from "./targets/goals/router"; import { ValidatePlaytypeFromParam } from "./middleware"; import scoresRouter from "./scores/router"; import songIDRouter from "./songs/_songID/router"; diff --git a/server/src/server/router/api/v1/games/_game/_playtype/goals/router.ts b/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts similarity index 95% rename from server/src/server/router/api/v1/games/_game/_playtype/goals/router.ts rename to server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts index ec7d3ab26..1d79578f4 100644 --- a/server/src/server/router/api/v1/games/_game/_playtype/goals/router.ts +++ b/server/src/server/router/api/v1/games/_game/_playtype/targets/goals/router.ts @@ -15,7 +15,7 @@ const router: Router = Router({ mergeParams: true }); /** * Retrieve goals that have been recently achieved for this game. * - * @name GET /api/v1/games/:game/:playtype/goals/recently-achieved + * @name GET /api/v1/games/:game/:playtype/targets/goals/recently-achieved */ router.get("/recently-achieved", async (req, res) => { const game = req[SYMBOL_TachiData]!.game!; @@ -81,7 +81,7 @@ const ResolveGoalID: RequestHandler = async (req, res, next) => { /** * Retrieve information about this goal and who is subscribed to it. * - * @name GET /api/v1/games/:game/:playtype/goals/:goalID + * @name GET /api/v1/games/:game/:playtype/targets/goals/:goalID */ router.get("/:goalID", ResolveGoalID, async (req, res) => { const goal = req[SYMBOL_TachiData]!.goalDoc!; @@ -108,7 +108,7 @@ router.get("/:goalID", ResolveGoalID, async (req, res) => { * * @param userID - The userID to evaluate this goal against. Must be a player of this GPT. * - * @name GET /api/v1/games/:game/:playtype/goals/:goalID/evaluate + * @name GET /api/v1/games/:game/:playtype/targets/goals/:goalID/evaluate */ router.get( "/:goalID/evaluate-for", diff --git a/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts b/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts new file mode 100644 index 000000000..63929423c --- /dev/null +++ b/server/src/server/router/api/v1/games/_game/_playtype/targets/router.ts @@ -0,0 +1,8 @@ +import { Router } from "express"; +import goalsRouter from "./goals/router"; + +const router: Router = Router({ mergeParams: true }); + +router.use("/goals", goalsRouter); + +export default router;