Skip to content

Commit

Permalink
refactor(enhance): getParams -> ctx.params
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwangchong committed Sep 17, 2023
1 parent fd4d44c commit 5cc3c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/enhance/src/context/handers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const enhanceQuery = (ctx: KoaContext): Context => {

export const enhanceParams = (ctx: KoaContext): Context => {
ctx.getParams = <T>(key?: string) => {
const params = Object.assign({}, ctx.getBody(), ctx.getQuery())
const params = ctx.params || {}
if (key) {
return params['key' as keyof typeof params]
}
Expand Down

0 comments on commit 5cc3c1f

Please sign in to comment.