Fix post syndication
This commit is contained in:
@@ -8,6 +8,8 @@ module Adamantium
|
|||||||
"post_utilities.slugify",
|
"post_utilities.slugify",
|
||||||
renderer: "renderers.markdown",
|
renderer: "renderers.markdown",
|
||||||
syndicate: "commands.posts.syndicate",
|
syndicate: "commands.posts.syndicate",
|
||||||
|
add_post_syndication_source: "commands.posts.add_syndication_source",
|
||||||
|
send_webmentions: "commands.posts.send_webmentions",
|
||||||
]
|
]
|
||||||
|
|
||||||
include Dry::Monads[:result]
|
include Dry::Monads[:result]
|
||||||
@@ -18,11 +20,17 @@ module Adamantium
|
|||||||
|
|
||||||
created_post = post_repo.create(attrs)
|
created_post = post_repo.create(attrs)
|
||||||
|
|
||||||
syndicate.call(attrs).bind do |result|
|
syndicate.call(attrs).bind do |results|
|
||||||
source, url = result
|
results.each do |result|
|
||||||
add_post_syndication_source.call(created_post.id, source, url)
|
source, url = result
|
||||||
|
add_post_syndication_source.call(created_post.id, source, url)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
decorated_post = Decorators::Posts::Decorator.new(created_post)
|
||||||
|
|
||||||
|
# send_webmentions.call(post_content: attrs[:content], post_url: decorated_post.permalink)
|
||||||
|
|
||||||
Success(created_post)
|
Success(created_post)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user