Skip to content

Commit 08e348c

Browse files
committed
fix: get by id
1 parent 800c394 commit 08e348c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/router/users.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
GUIDSchema,
44
InitUserSchema,
55
UpdateUserSchema,
6+
UserIDSchema,
67
} from "common/zod/schemas";
78
import { Hono } from "hono";
89
import { z } from "zod";
@@ -88,8 +89,8 @@ const router = new Hono()
8889
})
8990

9091
// idでユーザーを取得
91-
.get("/id/:id", async (c) => {
92-
const userId = await getUserId(c);
92+
.get("/id/:id", param({ id: UserIDSchema }), async (c) => {
93+
const userId = c.req.valid("param").id;
9394
const user = await getUserByID(userId);
9495
c.status(200);
9596
return c.json(user);

0 commit comments

Comments
 (0)