Allow editing of posts

This commit is contained in:
2023-09-16 13:25:56 +10:00
parent 3f6e333423
commit 9dc78255cf
5 changed files with 44 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
module Admin
module Commands
module Posts
class Update
include Deps[
"repos.post_repo",
"renderers.markdown"
]
def call(params:)
attrs_to_replace = {}
attrs_to_replace[:content] = markdown.call(content: params[:body]) if params[:body]
post_repo.update(params[:id], attrs_to_replace)
end
end
end
end
end