app/controllers/posts/restore.rb in octodmin-0.2.1 vs app/controllers/posts/restore.rb in octodmin-0.3.0
- old
+ new
@@ -1,14 +1,14 @@
+require_relative "manage"
+
module Octodmin::Controllers::Posts
- class Restore
+ class Restore < Manage
include Octodmin::Action
expose :post
def call(params)
- self.format = :json
+ super
- @post = Octodmin::Post.find(params[:id])
- halt 400, JSON.dump(errors: ["Could not find post"]) unless @post
@post.restore
end
end
end