respond with status 200 when publishing a draft

This commit is contained in:
Sami Samhuri 2015-04-29 08:16:35 -04:00
parent c00608761d
commit 6d0eb3f245

View file

@ -387,7 +387,7 @@ post '/posts/:year/:month/:id/unpublish' do |year, month, id|
if post = blog.get_post(year, month, id)
new_post = blog.unpublish_post(post)
status 201
status 200
headers 'Location' => url_for(new_post.url), 'Content-Type' => 'application/json'
JSON.generate(post: new_post.fields)
else