Add publish action
This commit is contained in:
16
slices/admin/actions/posts/publish.rb
Normal file
16
slices/admin/actions/posts/publish.rb
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
module Admin
|
||||||
|
module Actions
|
||||||
|
module Posts
|
||||||
|
class Publish < Action
|
||||||
|
|
||||||
|
include Deps["repos.post_repo"]
|
||||||
|
|
||||||
|
def handle(req, res)
|
||||||
|
post_id = req.params[:id]
|
||||||
|
|
||||||
|
post_repo.publish(id: post_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Reference in New Issue
Block a user