MCPcopy Index your code
hub / github.com/jaredly/hexo-admin / remove

Function remove

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

Source from the content-addressed store, hash-verified

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)

Callers 1

api.jsFile · 0.85

Calls 1

addIsDraftFunction · 0.85

Tested by

no test coverage detected