Skip to content

Commit c53cd65

Browse files
authored
fix hono Context (#677)
# PRの概要 honoのContext関連のエラーが出ないようにした ## 具体的な変更内容 returnを追加 ## 影響範囲 特になし ## 動作要件 特になし ## 補足 特になし ## レビューリクエストを出す前にチェック! - [x] 改めてセルフレビューしたか - [x] 手動での動作検証を行ったか - [x] server の機能追加ならば、テストを書いたか - 理由: 書いた | server の機能追加ではない - [x] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか - 理由: 書いた | 間違った使い方は存在しない - [x] わかりやすいPRになっているか <!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
1 parent 0b39bd1 commit c53cd65

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

server/src/router/matches.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const router = new Hono()
2828

2929
await deleteMatch(requesterId, opponentId as UserID);
3030
c.status(204);
31-
c.text("");
31+
return c.text("");
3232
},
3333
);
3434

server/src/router/picture.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ const router = new Hono()
5454

5555
return storage.getPic(hash, String(key)).then((buf) => {
5656
if (buf) {
57-
c.body(buf);
58-
} else {
59-
error("not found", 404);
57+
return c.body(buf);
6058
}
6159
});
6260
},

server/src/router/requests.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const router = new Hono()
4040

4141
await approveRequest(senderId as UserID, receiverId);
4242
c.status(201);
43-
c.json({});
43+
return c.json({});
4444
},
4545
)
4646

@@ -51,6 +51,7 @@ const router = new Hono()
5151
const opponentId = c.req.valid("param").opponentId;
5252
const requesterId = await getUserId(c);
5353
await cancelRequest(requesterId, opponentId);
54+
return c.json({});
5455
},
5556
)
5657

@@ -64,7 +65,7 @@ const router = new Hono()
6465

6566
await rejectRequest(opponentId as UserID, requesterId); //TODO 名前を良いのに変える
6667
c.status(204);
67-
c.json({});
68+
return c.json({});
6869
},
6970
);
7071

0 commit comments

Comments
 (0)