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:
commit
3fc58fc816
3 changed files with 0 additions and 21 deletions
|
@ -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,
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue