Merge pull request #641 from tejasmanohar/fix-this-v2-example
change `this` to `ctx` in v2 signature example
This commit is contained in:
commit
1f403cde74
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ app.use(async (ctx, next) => {
|
|||
})
|
||||
|
||||
app.use(async ctx => {
|
||||
const user = await User.getById(this.session.userid) // await instead of yield
|
||||
const user = await User.getById(ctx.session.userid) // await instead of yield
|
||||
ctx.body = user // ctx instead of this
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue