({ id, updates })
| 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); |