diff --git a/Gemfile.lock b/Gemfile.lock index 6877759..df4d79e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - embed_workflow (0.2.0) + embed_workflow (0.2.1) GEM remote: https://rubygems.org/ diff --git a/README.md b/README.md index 2ae2bf6..fed8ea2 100644 --- a/README.md +++ b/README.md @@ -127,17 +127,13 @@ EmbedWorkflow::Actions.activities(hashid: "7l0al") ### Upsert a user ```ruby -config = { - user_data: { - foo: "bar" - }, -} +data = { foo: "bar" } # Adding a new user -user = EmbedWorkflow::Users.upsert(key: "api-user-1", name: "Jane Doe", email: "jane@embedworkflow.com", config: config) +user = EmbedWorkflow::Users.upsert(key: "api-user-1", name: "Jane Doe", email: "jane@embedworkflow.com", data: data) # Updating a user -EmbedWorkflow::Users.upsert(name: "Jane Smith", id: user["id"], config: config) +EmbedWorkflow::Users.upsert(name: "Jane Smith", id: user["id"], data: data) ``` ### Fetch a user diff --git a/lib/embed_workflow/users.rb b/lib/embed_workflow/users.rb index df0a0ba..56766b1 100644 --- a/lib/embed_workflow/users.rb +++ b/lib/embed_workflow/users.rb @@ -11,12 +11,13 @@ class << self RESOURCE_BASE_PATH = "#{BASE_API_PATH}/users".freeze - def upsert(key:, name: nil, email: nil, config: nil) + def upsert(key:, name: nil, email: nil, data: nil, groups: nil) attrs = { key: key, name: name, email: email, - config: config + data: data, + groups: groups }.compact put_request( diff --git a/lib/embed_workflow/version.rb b/lib/embed_workflow/version.rb index d09300b..6d75425 100644 --- a/lib/embed_workflow/version.rb +++ b/lib/embed_workflow/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module EmbedWorkflow - VERSION = "0.2.0" + VERSION = "0.2.1" end diff --git a/spec/users_spec.rb b/spec/users_spec.rb index 793e460..a3e4855 100644 --- a/spec/users_spec.rb +++ b/spec/users_spec.rb @@ -82,7 +82,7 @@ context "with all parameters" do before do - config = { user_data: { foo: "bar" } } + data = { foo: "bar" } allow_any_instance_of(EmbedWorkflow::Client) .to receive(:put_request) .with({ @@ -91,19 +91,19 @@ key: "api-user-1", name: "Jane Doe", email: "jane@example.com", - config: config + data: data } }) .and_return("response") end it "sends the correct parameters to the users API" do - config = { user_data: { foo: "bar" } } + data = { foo: "bar" } EmbedWorkflow::Users.upsert( key: "api-user-1", name: "Jane Doe", email: "jane@example.com", - config: config + data: data ) end end