(id, body, res)
| 49 | } |
| 50 | |
| 51 | function remove(id, body, res) { |
| 52 | var post = hexo.model('Post').get(id) |
| 53 | if (!post) return res.send(404, "Post not found") |
| 54 | var newSource = '_discarded/' + post.source.slice('_drafts'.length) |
| 55 | update(id, {source: newSource}, function (err, post) { |
| 56 | if (err) { |
| 57 | return res.send(400, err); |
| 58 | } |
| 59 | res.done(addIsDraft(post)) |
| 60 | }, hexo) |
| 61 | } |
| 62 | |
| 63 | function publish(id, body, res) { |
| 64 | var post = hexo.model('Post').get(id) |