We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 800c394 commit 08e348cCopy full SHA for 08e348c
server/src/router/users.ts
@@ -3,6 +3,7 @@ import {
3
GUIDSchema,
4
InitUserSchema,
5
UpdateUserSchema,
6
+ UserIDSchema,
7
} from "common/zod/schemas";
8
import { Hono } from "hono";
9
import { z } from "zod";
@@ -88,8 +89,8 @@ const router = new Hono()
88
89
})
90
91
// idでユーザーを取得
- .get("/id/:id", async (c) => {
92
- const userId = await getUserId(c);
+ .get("/id/:id", param({ id: UserIDSchema }), async (c) => {
93
+ const userId = c.req.valid("param").id;
94
const user = await getUserByID(userId);
95
c.status(200);
96
return c.json(user);
0 commit comments