class GdsApi::Worldwide

def worldwide_organisation(path)

def worldwide_organisation(path)
  content_item = JSON.parse(get_raw("#{base_url}/content#{path}"))
  {
    "id" => "#{Plek.new.website_root}#{path}",
    "title" => content_item["title"],
    "format" => "Worldwide Organisation",
    "updated_at" => content_item["updated_at"],
    "web_url" => "#{Plek.new.website_root}#{path}",
    "details" => {
      "slug" => path.gsub("/world/organisations/", ""),
    },
    "analytics_identifier" => content_item["analytics_identifier"],
    "offices" => {
      "main" => format_office(content_item.dig("links", "main_office", 0)),
      "other" => content_item.dig("links", "home_page_offices")&.map do |office|
                   format_office(office)
                 end || [],
    },
    "sponsors" => content_item.dig("links", "sponsoring_organisations")&.map do |sponsor|
                    format_sponsor(sponsor)
                  end || [],
  }
end