Skip to content

Commit

Permalink
Merge pull request #9 from journy-io/identification-user-in-accounts
Browse files Browse the repository at this point in the history
🎨 Add identification wrapper around users
  • Loading branch information
hansott authored Aug 30, 2021
2 parents bd1f136 + 02022b8 commit 6790306
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,12 @@ public function addUsersToAccount(array $arguments): CallResult
),
"users" => array_map(
function (array $user) {
return $this->userIdentifiersToArray(
return ["identification" => $this->userIdentifiersToArray(
new UserIdentified(
isset($user["userId"]) ? (string) $user["userId"] : null,
isset($user["email"]) ? (string) $user["email"] : null
)
);
)];
},
array_values($arguments["users"])
)
Expand Down Expand Up @@ -666,12 +666,12 @@ public function removeUsersFromAccount(array $arguments): CallResult
),
"users" => array_map(
function (array $user) {
return $this->userIdentifiersToArray(
return ["identification" => $this->userIdentifiersToArray(
new UserIdentified(
isset($user["userId"]) ? (string) $user["userId"] : null,
isset($user["email"]) ? (string) $user["email"] : null
)
);
)];
},
array_values($arguments["users"])
)
Expand Down
8 changes: 4 additions & 4 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ public function test_it_adds_users_to_account()
"domain" => "journy.io",
],
"users" => [
["userId" => "1"],
["userId" => "2"],
["identification" => ["userId" => "1"]],
["identification" => ["userId" => "2"]],
],
],
$payload
Expand Down Expand Up @@ -395,8 +395,8 @@ public function test_it_removes_users_from_account()
"domain" => "journy.io",
],
"users" => [
["userId" => "1"],
["userId" => "2"],
["identification" => ["userId" => "1"]],
["identification" => ["userId" => "2"]],
],
],
$payload
Expand Down

0 comments on commit 6790306

Please sign in to comment.