Refactor micropub specific things out to a slice
This commit is contained in:
14
slices/micropub/commands/posts/undelete.rb
Normal file
14
slices/micropub/commands/posts/undelete.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
module Micropub
|
||||
module Commands
|
||||
module Posts
|
||||
class Undelete < Adamantium::Command
|
||||
include Deps["repos.post_repo"]
|
||||
def call(params:)
|
||||
slug = URI(params[:url]).path.split("/").last
|
||||
|
||||
post_repo.restore!(slug)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user