Skip to content
Permalink
Browse files

Fixed issue #2730: Registering of Twitter App fails for Twitter App w…

…ith existing webhooks.
  • Loading branch information...
thorsteneckel committed Sep 3, 2019
1 parent 1c730e9 commit 39c78662d0cf1b03c9da433c6489e93f0132ca80
@@ -26,6 +26,7 @@ def destroy
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 @@ def self.register_webhook(params)

# 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 @@ def 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

0 comments on commit 39c7866

Please sign in to comment.
You can’t perform that action at this time.