Fixed issue #2730: Registering of Twitter App fails for Twitter App with existing webhooks.
This commit is contained in:
parent
1c730e9154
commit
39c78662d0
3 changed files with 4 additions and 3 deletions
|
@ -26,6 +26,7 @@ class ExternalCredentialsController < ApplicationController
|
|||
def app_verify
|
||||
render json: { attributes: ExternalCredential.app_verify(params.permit!.to_h) }, status: :ok
|
||||
rescue => e
|
||||
logger.error e
|
||||
render json: { error: e.message }, status: :ok
|
||||
end
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ class ExternalCredential::Twitter
|
|||
|
||||
# delete already registered webhooks
|
||||
webhooks.each do |webhook|
|
||||
client.webhook_delete(webhook[:id])
|
||||
client.webhook_delete(webhook[:id], env_name)
|
||||
end
|
||||
|
||||
# register new webhook
|
||||
|
|
|
@ -909,11 +909,11 @@ get all webhooks
|
|||
delete a webhooks
|
||||
|
||||
client = TwitterSync.new
|
||||
webhook_delete(webhook_id)
|
||||
webhook_delete(webhook_id, env_name)
|
||||
|
||||
=end
|
||||
|
||||
def webhook_delete(webhook_id)
|
||||
def webhook_delete(webhook_id, env_name)
|
||||
Twitter::REST::Request.new(@client, :delete, "/1.1/account_activity/all/#{env_name}/webhooks/#{webhook_id}.json", {}).perform
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue