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

Method list

sequelize/app/service/user.js:6–12  ·  view source on GitHub ↗
({ offset = 0, limit = 10 })

Source from the content-addressed store, hash-verified

4
5class User extends Service {
6 async list({ offset = 0, limit = 10 }) {
7 return this.ctx.model.User.findAndCountAll({
8 offset,
9 limit,
10 order: [[ 'created_at', 'desc' ], [ 'id', 'desc' ]],
11 });
12 }
13
14 async find(id) {
15 const user = await this.ctx.model.User.findByPk(id);

Callers 3

post.test.jsFile · 0.45
indexMethod · 0.45
indexMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected