diff --git a/server/src/router/users.ts b/server/src/router/users.ts index 51607cc4..771c9fca 100644 --- a/server/src/router/users.ts +++ b/server/src/router/users.ts @@ -3,6 +3,7 @@ import { GUIDSchema, InitUserSchema, UpdateUserSchema, + UserIDSchema, } from "common/zod/schemas"; import { Hono } from "hono"; import { z } from "zod"; @@ -88,8 +89,8 @@ const router = new Hono() }) // idでユーザーを取得 - .get("/id/:id", async (c) => { - const userId = await getUserId(c); + .get("/id/:id", param({ id: UserIDSchema }), async (c) => { + const userId = c.req.valid("param").id; const user = await getUserByID(userId); c.status(200); return c.json(user);