Allow editing deleted posts

This commit is contained in:
2023-03-20 21:07:12 +11:00
parent f40dd2392d
commit 0b2432fd60
2 changed files with 8 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ module Adamantium
def call(url:, properties:)
slug = URI(url).path.split("/").last
post = post_repo.fetch!(slug)
post = post_repo.fetch_unpublished!(slug)
markdown_content = ReverseMarkdown.convert(post.content, unknown_tags: :pass_through, github_flavored: true).to_s
if properties.nil? || properties.empty?

View File

@@ -161,6 +161,13 @@ module Adamantium
.one!
end
def fetch_unpublished!(slug)
posts
.combine(:tags)
.where(slug: slug)
.one!
end
def find!(id)
posts
.by_pk(id)