From 95745941515f5288cb21440d1281e5f4fde863db Mon Sep 17 00:00:00 2001 From: Nan Kyung Lee Date: Fri, 6 Mar 2026 16:34:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(users):=20/orgs=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=8A=B8=EB=A5=BC=20/:id=20=EC=95=9E=EC=97=90=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=ED=95=98=EC=97=AC=20=EB=9D=BC=EC=9A=B0=ED=8A=B8=20?= =?UTF-8?q?=EB=A7=A4=EC=B9=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Express에서 /orgs가 /:id 뒤에 등록되어 'orgs'가 파라미터로 잡히던 버그 수정 Co-Authored-By: Claude Opus 4.6 --- backend/src/users/userRouter.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/src/users/userRouter.ts b/backend/src/users/userRouter.ts index a8a26a3..beb5926 100644 --- a/backend/src/users/userRouter.ts +++ b/backend/src/users/userRouter.ts @@ -31,6 +31,17 @@ router.get('/', async (req, res) => { } }) +// GET /api/users/orgs — 조직 목록 (/:id 보다 앞에 등록해야 함) +router.get('/orgs', async (_req, res) => { + try { + const orgs = await listOrgs() + res.json(orgs) + } catch (err) { + console.error('[users] 조직 목록 오류:', err) + res.status(500).json({ error: '조직 목록 조회 중 오류가 발생했습니다.' }) + } +}) + // GET /api/users/:id router.get('/:id', async (req, res) => { try { @@ -146,15 +157,4 @@ router.put('/:id/roles', async (req, res) => { } }) -// GET /api/users/orgs — 조직 목록 -router.get('/orgs', async (_req, res) => { - try { - const orgs = await listOrgs() - res.json(orgs) - } catch (err) { - console.error('[users] 조직 목록 오류:', err) - res.status(500).json({ error: '조직 목록 조회 중 오류가 발생했습니다.' }) - } -}) - export default router