Allow editing deleted posts
This commit is contained in:
@@ -9,7 +9,7 @@ module Adamantium
|
|||||||
def call(url:, properties:)
|
def call(url:, properties:)
|
||||||
slug = URI(url).path.split("/").last
|
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
|
markdown_content = ReverseMarkdown.convert(post.content, unknown_tags: :pass_through, github_flavored: true).to_s
|
||||||
|
|
||||||
if properties.nil? || properties.empty?
|
if properties.nil? || properties.empty?
|
||||||
|
@@ -161,6 +161,13 @@ module Adamantium
|
|||||||
.one!
|
.one!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fetch_unpublished!(slug)
|
||||||
|
posts
|
||||||
|
.combine(:tags)
|
||||||
|
.where(slug: slug)
|
||||||
|
.one!
|
||||||
|
end
|
||||||
|
|
||||||
def find!(id)
|
def find!(id)
|
||||||
posts
|
posts
|
||||||
.by_pk(id)
|
.by_pk(id)
|
||||||
|
Reference in New Issue
Block a user