(id, body, res)
| 61 | } |
| 62 | |
| 63 | function publish(id, body, res) { |
| 64 | var post = hexo.model('Post').get(id) |
| 65 | if (!post) return res.send(404, "Post not found") |
| 66 | var newSource = '_posts/' + post.source.slice('_drafts/'.length) |
| 67 | update(id, {source: newSource}, function (err, post) { |
| 68 | if (err) { |
| 69 | return res.send(400, err); |
| 70 | } |
| 71 | res.done(addIsDraft(post)) |
| 72 | }, hexo) |
| 73 | } |
| 74 | |
| 75 | function unpublish(id, body, res) { |
| 76 | var post = hexo.model('Post').get(id) |