Add books page
This commit is contained in:
19
app/commands/posts/create_book_post.rb
Normal file
19
app/commands/posts/create_book_post.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
require "dry/monads"
|
||||
|
||||
module Adamantium
|
||||
module Commands
|
||||
module Posts
|
||||
class CreateBookPost < Command
|
||||
include Deps["repos.post_repo"]
|
||||
|
||||
include Dry::Monads[:result]
|
||||
|
||||
def call(post)
|
||||
created_post = post_repo.create(post)
|
||||
|
||||
Success(created_post)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user