Photo param parsing
This commit is contained in:
@@ -59,10 +59,16 @@ module Micropub
|
|||||||
params[:properties][:content].first&.tr("\n", " ")
|
params[:properties][:content].first&.tr("\n", " ")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
photos = if params[:properties][:photo].is_a?(String)
|
photos = if params[:properties][:photo].is_a?(Array)
|
||||||
|
params[:properties][:photo].map do |p|
|
||||||
|
{value: p, alt: ""}
|
||||||
|
end
|
||||||
|
elsif params[:properties][:photo].is_a?(Hash)
|
||||||
|
params[:properties][:photo]
|
||||||
|
elsif
|
||||||
{value: params[:properties][:photo], alt: ""}
|
{value: params[:properties][:photo], alt: ""}
|
||||||
else
|
else
|
||||||
params[:properties][:photo] || []
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
new_params.merge({
|
new_params.merge({
|
||||||
|
Reference in New Issue
Block a user