Skip to content

Commit

Permalink
docs: fix yield db.query for en (#930)
Browse files Browse the repository at this point in the history
Same as #921.
  • Loading branch information
coogleyao authored and popomore committed May 17, 2017
1 parent 25c7c95 commit 12499d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/en/basics/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Simply speaking, Service is an abstract layer which is used to encapsulate busin
module.exports = app => {
class User extends app.Service {
* find(uid) {
const user = this.ctx.db.query(`select * from user where uid = ${uid}`);
const user = yield this.ctx.db.query(`select * from user where uid = ${uid}`);
return user;
}
}
Expand Down Expand Up @@ -80,7 +80,7 @@ module.exports = app => {

* find(uid) {
// suppose we've got user's id and are going to get detailed user information from databases
const user = this.ctx.db.query(`select * from user where uid = ${uid}`);
const user = yield this.ctx.db.query(`select * from user where uid = ${uid}`);

// suppose some complex processes should be made here, and demanded informations are returned then.
const picture = yield this.getPicture(uid);
Expand Down

0 comments on commit 12499d6

Please sign in to comment.