MCPcopy
hub / github.com/jaredly/hexo-admin / unpublish

Function unpublish

api.js:75–85  ·  view source on GitHub ↗
(id, body, res)

Source from the content-addressed store, hash-verified

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'

Callers 1

api.jsFile · 0.85

Calls 1

addIsDraftFunction · 0.85

Tested by

no test coverage detected