Add photos to source response

This commit is contained in:
2023-02-03 11:23:56 +11:00
parent 19fe581c79
commit e64dacf8ba
2 changed files with 14 additions and 1 deletions

View File

@@ -7,7 +7,18 @@ module Adamantium
def call(params:)
slug = URI(params[:url]).path.split("/").last
post = post_repo.fetch!(slug)
post_repo.update(post.id, params)
if prams.key? :replace
post_repo.update(post.id, params)
end
if params.key? :add
end
if params.key? :delete
end
end
end
end

View File

@@ -18,6 +18,7 @@ module Adamantium
properties: {
published: [post.published_at],
content: [markdown_content],
photo: post.photos,
category: post.tags.map { |t| t.label.to_s }
}
}
@@ -27,6 +28,7 @@ module Adamantium
result[:properties][:published] = [post.published_at] if properties.include? "published"
result[:properties][:content] = [markdown_content] if properties.include? "content"
result[:properties][:category] = post.tags.map { |t| t.label.to_s } if properties.include? "category"
result[:properties][:photos] = post.photos if properties.include? "photos"
result
end
end