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

Method update

sequelize/app/service/user.js:26–32  ·  view source on GitHub ↗
({ id, updates })

Source from the content-addressed store, hash-verified

24 }
25
26 async update({ id, updates }) {
27 const user = await this.ctx.model.User.findByPk(id);
28 if (!user) {
29 this.ctx.throw(404, 'user not found');
30 }
31 return user.update(updates);
32 }
33
34 async del(id) {
35 const user = await this.ctx.model.User.findByPk(id);

Callers 1

post.test.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected