Allow adding of syndication sources after a post is created
This commit is contained in:
21
slices/admin/actions/posts/add_syndication_source.rb
Normal file
21
slices/admin/actions/posts/add_syndication_source.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module Actions
|
||||
module Posts
|
||||
class AddSyndicationSource < Admin::Action
|
||||
include Deps["commands.posts.add_syndication_source"]
|
||||
|
||||
def handle(req, res)
|
||||
add_syndication_source.call(post_id: req.params[:id],
|
||||
source_name: req.params[:syndication_source_name],
|
||||
source_url: req.params[:syndication_source_url]
|
||||
)
|
||||
|
||||
res.status = 201
|
||||
res.headers["HX-Refresh"] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user