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

Function publish

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

Source from the content-addressed store, hash-verified

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)

Callers 1

api.jsFile · 0.85

Calls 1

addIsDraftFunction · 0.85

Tested by

no test coverage detected