({ id, user_id })
| 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 | |
| 52 | module.exports = Post; |
no test coverage detected