Skip to content

Commit

Permalink
export region type
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 8, 2020
1 parent 611257a commit 8878662
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/controllers/export_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class ExportController < ApplicationController
"registration_agency" => "DOI Registration Agency"
}

REGIONS = {
"APAC" => "Asia and Pacific",
"EMEA" => "EMEA",
"AMER" => "Americas"
}

def contacts
authorize! :export, :contacts

Expand Down Expand Up @@ -155,7 +161,7 @@ def organizations
isActive: provider.deleted_at.blank?,
accountDescription: provider.description,
accountWebsite: provider.website,
region: provider.region,
region: provider.region.present? ? export_region(provider.region) : nil,
focusArea: provider.focus_area,
sector: provider.organization_type,
accountType: export_member_type(provider.member_type),
Expand Down Expand Up @@ -287,4 +293,8 @@ def export_date(date)
def export_member_type(member_type)
MEMBER_TYPES[member_type]
end

def export_region(region)
REGIONS[region]
end
end

0 comments on commit 8878662

Please sign in to comment.