Tag posts from the admin area

This commit is contained in:
2024-02-11 10:11:04 +11:00
parent 1172ba20ec
commit 9ab228fde0
4 changed files with 47 additions and 4 deletions

View File

@@ -11,7 +11,13 @@ module Admin
attrs_to_replace = {}
attrs_to_replace[:content] = markdown.call(content: params[:body]) if params[:body]
tags = params[:tags].split(",").map(&:strip)
post_repo.update(params[:id], attrs_to_replace)
if tags && !tags.empty?
post_repo.remove_tags(post_id: params[:id])
post_repo.tag_post(post_id: params[:id], tags: tags)
end
end
end
end