Skip to content

Commit 87585cd

Browse files
committed
update attachRouter function types
1 parent 9ef9ccc commit 87585cd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/flat-pianos-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nextjs-koa-api': patch
3+
---
4+
5+
update function `attachRouter` to accept `KoaApi` with any context

lib/koa-api/src/koa-api.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ export function withKoaApi(koa: KoaApi<any, any>) {
105105
* @param path - path to attach the router to
106106
* @param router - router to attach
107107
*/
108-
export function attachRouter(path: string, app: KoaApi, router: Router) {
108+
export function attachRouter(
109+
path: string,
110+
app: KoaApi<any, any>,
111+
router: Router
112+
) {
109113
app.use(router.prefix(path).routes()).use(router.allowedMethods())
110114
}

0 commit comments

Comments
 (0)