Fix location parsing

This commit is contained in:
2024-02-24 15:44:29 +11:00
parent 363dbd5423
commit e6178f4c1d

View File

@@ -139,7 +139,7 @@ module Micropub
location = if params.dig(:properties, :location) location = if params.dig(:properties, :location)
params.dig(:properties, :location).first[:properties] params.dig(:properties, :location).first[:properties]
elsif checkin.dig(:properties, :latitude) && checkin.dig(:properties, :longitude) elsif checkin.dig(:properties, :latitude) && checkin.dig(:properties, :longitude)
{latitude: checkin.dig(:properties, :latitude).first, longitude: checkin.dig(:properties, :longitude).first} {latitude: checkin.dig(:properties, :latitude), longitude: checkin.dig(:properties, :longitude)}
end end
new_params[:photos] = params.dig(:properties, :photo)&.map { |p| {value: p, alt: new_params[:name]} } || [] new_params[:photos] = params.dig(:properties, :photo)&.map { |p| {value: p, alt: new_params[:name]} } || []