(id, body, res)
| 73 | } |
| 74 | |
| 75 | function unpublish(id, body, res) { |
| 76 | var post = hexo.model('Post').get(id) |
| 77 | if (!post) return res.send(404, "Post not found") |
| 78 | var newSource = '_drafts/' + post.source.slice('_posts/'.length) |
| 79 | update(id, {source: newSource}, function (err, post) { |
| 80 | if (err) { |
| 81 | return res.send(400, err); |
| 82 | } |
| 83 | res.done(addIsDraft(post)) |
| 84 | }, hexo) |
| 85 | } |
| 86 | |
| 87 | function rename(id, body, res) { |
| 88 | var model = 'Post' |