From c99a4882c71397c58716e3f3df9cc721e9382f06 Mon Sep 17 00:00:00 2001 From: julia-weppler-1 <156942916+julia-weppler-1@users.noreply.github.com> Date: Sun, 19 Jul 2026 21:14:19 -0400 Subject: [PATCH] Refactor GET method in challenges route Refactor long GET method in challenges route for better readability and maintainability. --- server/routes/challenges.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routes/challenges.js b/server/routes/challenges.js index 8b3f23c..fe6ffd5 100644 --- a/server/routes/challenges.js +++ b/server/routes/challenges.js @@ -81,6 +81,9 @@ router.post("/", async (req, res) => { // profile and this user's own acceptance (if any). Expired challenges the user // never accepted are dropped, and any accepted challenge whose window has closed // is resolved to completed/failed on the way out. + +// This get is very long and performs a write operation. These are not technically bugs in the code +// but maybe it would be best to have a separate smaller method for the write which the get can call? router.get("/", async (req, res) => { try { const myId = req.user._id.toString();