Skip to content

Commit

Permalink
Update action_code param to action for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronzhongg committed Jun 26, 2024
1 parent c1a13ec commit 797b866
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/authsignal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def get_user(user_id:, redirect_url: nil)
response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
end

def get_action(user_id:, action_code:, idempotency_key:)
response = Client.new.get_action(user_id, action_code, idempotency_key)
def get_action(user_id:, action:, idempotency_key:)
response = Client.new.get_action(user_id, action, idempotency_key)
response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/authsignal/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def validate_challenge(user_id: nil, token:)
handle_response(response)
end

def get_action(user_id, action_code, idempotency_key)
get("/users/#{ERB::Util.url_encode(user_id)}/actions/#{action_code}/#{ERB::Util.url_encode(idempotency_key)}")
def get_action(user_id, action, idempotency_key)
get("/users/#{ERB::Util.url_encode(user_id)}/actions/#{action}/#{ERB::Util.url_encode(idempotency_key)}")
end

def identify(user_id, user_payload)
Expand Down
2 changes: 1 addition & 1 deletion lib/authsignal/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Authsignal
VERSION = "2.0.0"
VERSION = "2.1.0"
end
2 changes: 1 addition & 1 deletion spec/authsignal/authsignal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

response = Authsignal.get_action(
user_id: 1,
action_code: "testAction",
action: "testAction",
idempotency_key: "15cac140-f639-48c5-92db-835ec8d3d144")


Expand Down

0 comments on commit 797b866

Please sign in to comment.