MCPcopy Index your code
hub / github.com/eggjs/examples / destroy

Method destroy

sequelize/app/service/post.js:45–49  ·  view source on GitHub ↗
({ id, user_id })

Source from the content-addressed store, hash-verified

43 }
44
45 async destroy({ id, user_id }) {
46 const post = await this.ctx.model.Post.findByIdWithUser(id, user_id);
47 if (!post) this.ctx.throw(404, 'post not found');
48 return post.destroy();
49 }
50}
51
52module.exports = Post;

Callers 3

.setup.jsFile · 0.45
post.test.jsFile · 0.45
delMethod · 0.45

Calls 1

findByIdWithUserMethod · 0.80

Tested by

no test coverage detected