class GdsApi::Worldwide

def format_locations(locations, type)

def format_locations(locations, type)
  locations&.map do |location|
    {
      "id" => "#{Plek.new.website_root}/world/#{location['slug']}",
      "title" => location["name"],
      "format" => type,
      "updated_at" => location["updated_at"],
      "web_url" => "#{Plek.new.website_root}/world/#{location['slug']}",
      "analytics_identifier" => location["analytics_identifier"],
      "details" => {
        "slug" => location["slug"],
        "iso2" => location["iso2"],
      },
      "organisations" => {
        "id" => "#{Plek.new.website_root}/world/#{location['slug']}#organisations",
        "web_url" => "#{Plek.new.website_root}/world/#{location['slug']}#organisations",
      },
      "content_id" => location["content_id"],
    }
  end
end