Merge pull request #3858 from betagouv/fix-contact-form

Corrige l'erreur 500 après l'envoi d'un message via le formulaire de contact
This commit is contained in:
Keirua 2019-05-13 12:39:59 +02:00 committed by GitHub
commit 3fc58fc816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 21 deletions

View file

@ -22,17 +22,6 @@ class Helpscout::API
})
end
def add_custom_fields(conversation_id, dossier_id, browser)
body = {
'Dossier ID': dossier_id,
'Browser': browser
}.compact.map do |key, value|
{ id: custom_fields[key], value: value }
end
call_api(:put, "#{CONVERSATIONS}/#{conversation_id}/#{FIELDS}", { fields: body })
end
def create_conversation(email, subject, text, file)
body = {
subject: subject,

View file

@ -41,8 +41,6 @@ class Helpscout::FormAdapter
if conversation_id.present?
add_tags(conversation_id)
add_custom_fields(conversation_id)
true
else
false
@ -55,10 +53,6 @@ class Helpscout::FormAdapter
@api.add_tags(conversation_id, params[:tags])
end
def add_custom_fields(conversation_id)
@api.add_custom_fields(conversation_id, params[:dossier_id], params[:browser])
end
def create_conversation
response = @api.create_conversation(
params[:email],

View file

@ -62,8 +62,6 @@ describe Helpscout::FormAdapter do
.with(email, subject, text, nil)
expect(api).to have_received(:add_tags)
.with(conversation_id, tags)
expect(api).to have_received(:add_custom_fields)
.with(conversation_id, nil, nil)
end
end
@ -102,8 +100,6 @@ describe Helpscout::FormAdapter do
.with(email, subject, text, nil)
expect(api).to have_received(:add_phone_number)
.with(email, phone)
expect(api).to have_received(:add_custom_fields)
.with(conversation_id, nil, nil)
end
end
end