Skip to content

Commit

Permalink
Ticket CV2-4559: Log Facebook Messenger request information only when…
Browse files Browse the repository at this point in the history
… the output is not the expected one
  • Loading branch information
caiosba committed Jun 8, 2024
1 parent ff12dfb commit 8349d56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def save_facebook_credentials_for_smooch_bot(platform) # "platform" is either "i
limit: 100,
}
response = Net::HTTP.get_response(URI("https://graph.facebook.com/me/accounts?#{q_params.to_query}"))
Rails.logger.info("[Facebook Messenger Integration] API scoped token: #{auth['token']} API response: #{response.body}")
pages = JSON.parse(response.body)['data']
if pages.size != 1
Rails.logger.info("[Facebook Messenger Integration] API scoped token: #{auth['token']} API response: #{response.body}")
CheckSentry.notify(StandardError.new('Unexpected list of Facebook pages returned for tipline Messenger integration'), team_bot_installation_id: tbi.id, response: response.body)
@message = I18n.t(:must_select_exactly_one_facebook_page)
status = 400
Expand Down

0 comments on commit 8349d56

Please sign in to comment.