From d97da75d18378274e0769491ed1edc1096bb853d Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Fri, 3 Feb 2023 11:32:02 +1100 Subject: [PATCH] Render content when updating posts --- app/commands/posts/update.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/commands/posts/update.rb b/app/commands/posts/update.rb index 67b215e..1683f06 100644 --- a/app/commands/posts/update.rb +++ b/app/commands/posts/update.rb @@ -2,14 +2,14 @@ module Adamantium module Commands module Posts class Update < Command - include Deps["repos.post_repo"] + include Deps["repos.post_repo", "renderers.markdown"] def call(params:) slug = URI(params[:url]).path.split("/").last post = post_repo.fetch!(slug) if params.key? :replace - post_repo.update(post.id, params) + post_repo.update(post.id, {content: markdown.call(content: params[:content])}) end if params.key? :add