diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb index 19c83214b..8bfc87acf 100644 --- a/app/controllers/exports_controller.rb +++ b/app/controllers/exports_controller.rb @@ -30,8 +30,8 @@ def contacts "fabricaId" => contact.provider.symbol + "-" + contact.email, "email" => contact.email, "firstName" => contact.given_name, - "lastName" => contact.family_name, - "type" => contact.role_name ? contact.role_name.join(";") : nil, + "lastName" => contact.family_name.present? ? contact.family_name : contact.email, + "type" => contact.role_name ? 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,