From b9291757a4443b2ee11e0880b3b39d30e3be85af Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 27 Jul 2021 22:11:44 -0400 Subject: [PATCH] Issue #749 - API error when calling /export/contacts. (Add array.wrap) --- app/controllers/exports_controller.rb | 2 +- app/controllers/v3/exports_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb index 8bfc87acf..763b34b43 100644 --- a/app/controllers/exports_controller.rb +++ b/app/controllers/exports_controller.rb @@ -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, diff --git a/app/controllers/v3/exports_controller.rb b/app/controllers/v3/exports_controller.rb index 3f086150f..82df512b3 100644 --- a/app/controllers/v3/exports_controller.rb +++ b/app/controllers/v3/exports_controller.rb @@ -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,