From 689f2b5a6eefee6aaafc52a3992637f81ca6597d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 15:56:45 +0000 Subject: [PATCH] Simplify place-id/apiKey validation logic per review feedback --- routes/dashboard.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/routes/dashboard.js b/routes/dashboard.js index bb004f5..430c066 100644 --- a/routes/dashboard.js +++ b/routes/dashboard.js @@ -103,13 +103,9 @@ router.post('/places', (req, res) => { return res.status(403).json({ success: false, message: "Only admins can set a custom place id or API key" }); } - if (!canSetCustomValues) { - id = ''; - apiKey = ''; - } else { - id = id ? String(id).trim() : ''; - apiKey = apiKey ? String(apiKey).trim() : ''; - } + // If we reach here, either the caller is an admin, or both id and apiKey were already falsy. + id = id ? String(id).trim() : ''; + apiKey = apiKey ? String(apiKey).trim() : ''; if (!id) id = generatePlaceId(); if (!apiKey) apiKey = generateApiKey();