Add photos to source response
This commit is contained in:
@@ -7,7 +7,18 @@ module Adamantium
|
|||||||
def call(params:)
|
def call(params:)
|
||||||
slug = URI(params[:url]).path.split("/").last
|
slug = URI(params[:url]).path.split("/").last
|
||||||
post = post_repo.fetch!(slug)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@@ -18,6 +18,7 @@ module Adamantium
|
|||||||
properties: {
|
properties: {
|
||||||
published: [post.published_at],
|
published: [post.published_at],
|
||||||
content: [markdown_content],
|
content: [markdown_content],
|
||||||
|
photo: post.photos,
|
||||||
category: post.tags.map { |t| t.label.to_s }
|
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][:published] = [post.published_at] if properties.include? "published"
|
||||||
result[:properties][:content] = [markdown_content] if properties.include? "content"
|
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][:category] = post.tags.map { |t| t.label.to_s } if properties.include? "category"
|
||||||
|
result[:properties][:photos] = post.photos if properties.include? "photos"
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user