Skip to content

Commit

Permalink
Merge pull request #750 from datacite/issue-749
Browse files Browse the repository at this point in the history
Issue #749 - API error when calling /export/contacts. (Add array.wrap)
  • Loading branch information
svogt0511 authored Jul 28, 2021
2 parents 7c332ef + b929175 commit d0da95e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def contacts
"email" => contact.email,
"firstName" => contact.given_name,
"lastName" => contact.family_name.present? ? contact.family_name : contact.email,
"type" => contact.role_name ? contact.role_name.map { |r| r.camelize(:lower) }.join(";") : nil,
"type" => contact.role_name ? Array.wrap(contact.role_name).map { |r| r.camelize(:lower) }.join(";") : nil,
"createdAt" => export_date_string(contact.created_at),
"modifiedAt" => export_date_string(contact.updated_at),
"deletedAt" => contact.deleted_at.present? ? export_date_string(contact.deleted_at) : nil,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/v3/exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def contacts
"email" => contact.email,
"firstName" => contact.given_name,
"lastName" => contact.family_name,
"type" => contact.role_name ? contact.role_name.join(";") : nil,
"type" => contact.role_name ? Array.wrap(contact.role_name).join(";") : nil,
"createdAt" => export_date_string(contact.created_at),
"modifiedAt" => export_date_string(contact.updated_at),
"deletedAt" => contact.deleted_at.present? ? export_date_string(contact.deleted_at) : nil,
Expand Down

0 comments on commit d0da95e

Please sign in to comment.