MCPcopy Create free account
hub / github.com/eggjs/examples / find

Method find

sequelize/app/service/user.js:14–20  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

12 }
13
14 async find(id) {
15 const user = await this.ctx.model.User.findByPk(id);
16 if (!user) {
17 this.ctx.throw(404, 'user not found');
18 }
19 return user;
20 }
21
22 async create(user) {
23 return this.ctx.model.User.create(user);

Callers 3

post.test.jsFile · 0.45
showMethod · 0.45
showMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected