Skip to content

Commit

Permalink
Update Webhook's Rotate Secret (#465)
Browse files Browse the repository at this point in the history
Changed Action and URL path
  • Loading branch information
atejada authored Feb 21, 2024
1 parent 7c619b5 commit 3269e78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/nylas/resources/webhooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def destroy(webhook_id:)
# @param webhook_id [String] The ID of the webhook destination to update.
# @return [Array(Hash, String)] The updated webhook destination and API Request ID.
def rotate_secret(webhook_id:)
put(
path: "#{api_uri}/v3/webhooks/#{webhook_id}/rotate-secret",
post(
path: "#{api_uri}/v3/webhooks/rotate-secret/#{webhook_id}",
request_body: {}
)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/nylas/resources/webhooks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
describe "#rotate_secret" do
it "calls the put method with the correct parameters" do
webhook_id = "webhook-123"
path = "#{api_uri}/v3/webhooks/#{webhook_id}/rotate-secret"
path = "#{api_uri}/v3/webhooks/rotate-secret/#{webhook_id}"

allow(webhooks).to receive(:put)
allow(webhooks).to receive(:post)
.with(path: path, request_body: {})

webhooks.rotate_secret(webhook_id: webhook_id)
Expand Down

0 comments on commit 3269e78

Please sign in to comment.