Skip to content

Commit 6790306

Browse files
authored
Merge pull request #9 from journy-io/identification-user-in-accounts
🎨 Add identification wrapper around users
2 parents bd1f136 + 02022b8 commit 6790306

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,12 @@ public function addUsersToAccount(array $arguments): CallResult
591591
),
592592
"users" => array_map(
593593
function (array $user) {
594-
return $this->userIdentifiersToArray(
594+
return ["identification" => $this->userIdentifiersToArray(
595595
new UserIdentified(
596596
isset($user["userId"]) ? (string) $user["userId"] : null,
597597
isset($user["email"]) ? (string) $user["email"] : null
598598
)
599-
);
599+
)];
600600
},
601601
array_values($arguments["users"])
602602
)
@@ -666,12 +666,12 @@ public function removeUsersFromAccount(array $arguments): CallResult
666666
),
667667
"users" => array_map(
668668
function (array $user) {
669-
return $this->userIdentifiersToArray(
669+
return ["identification" => $this->userIdentifiersToArray(
670670
new UserIdentified(
671671
isset($user["userId"]) ? (string) $user["userId"] : null,
672672
isset($user["email"]) ? (string) $user["email"] : null
673673
)
674-
);
674+
)];
675675
},
676676
array_values($arguments["users"])
677677
)

tests/ClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ public function test_it_adds_users_to_account()
352352
"domain" => "journy.io",
353353
],
354354
"users" => [
355-
["userId" => "1"],
356-
["userId" => "2"],
355+
["identification" => ["userId" => "1"]],
356+
["identification" => ["userId" => "2"]],
357357
],
358358
],
359359
$payload
@@ -395,8 +395,8 @@ public function test_it_removes_users_from_account()
395395
"domain" => "journy.io",
396396
],
397397
"users" => [
398-
["userId" => "1"],
399-
["userId" => "2"],
398+
["identification" => ["userId" => "1"]],
399+
["identification" => ["userId" => "2"]],
400400
],
401401
],
402402
$payload

0 commit comments

Comments
 (0)