Syndicate to Day One from Admin pages

This commit is contained in:
2023-06-11 14:25:30 +10:00
parent 0776283aae
commit 15cdd40f75
9 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
require "readability"
require "down"
module Admin
module Commands
module Posts
class Syndicate
include Dry::Monads[:result]
include Deps["repos.post_repo", "syndication.dayone"]
def call(post_id:, target:)
post = post_repo.find(id: post_id)
dayone.(name: post[:name], content: post[:content]) if target.to_sym == :day_one
Success()
end
end
end
end
end