Skip to content

Commit

Permalink
Merge pull request #20 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 c94dbeb + 53860b4 commit fc7b78f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 10 additions & 4 deletions lib/Client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,10 @@ describe("Client", () => {
}),
JSON.stringify({
account: { accountId: "aId" },
users: [{ userId: "uId" }, { email: "[email protected]" }],
users: [
{ identification: { userId: "uId" } },
{ identification: { email: "[email protected]" } },
],
})
);

Expand Down Expand Up @@ -767,7 +770,10 @@ describe("Client", () => {
}),
JSON.stringify({
account: { accountId: "aId" },
users: [{ userId: "uId" }, { email: "[email protected]" }],
users: [
{ identification: { userId: "uId" } },
{ identification: { email: "[email protected]" } },
],
})
);

Expand Down Expand Up @@ -821,7 +827,7 @@ describe("Client", () => {
}),
JSON.stringify({
account: { accountId: "aId" },
users: [{ userId: "uId" }],
users: [{ identification: { userId: "uId" } }],
})
);

Expand Down Expand Up @@ -849,7 +855,7 @@ describe("Client", () => {
}),
JSON.stringify({
account: { accountId: "aId" },
users: [{ userId: "uId" }],
users: [{ identification: { userId: "uId" } }],
})
);

Expand Down
8 changes: 6 additions & 2 deletions lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export class Client {
}),
JSON.stringify({
account: this.getAccountIdentification(args.account),
users: args.users.map((user) => this.getUserIdentification(user)),
users: args.users.map((user) => {
return { identification: this.getUserIdentification(user) };
}),
})
);

Expand Down Expand Up @@ -340,7 +342,9 @@ export class Client {
}),
JSON.stringify({
account: this.getAccountIdentification(args.account),
users: args.users.map((user) => this.getUserIdentification(user)),
users: args.users.map((user) => {
return { identification: this.getUserIdentification(user) };
}),
})
);

Expand Down

0 comments on commit fc7b78f

Please sign in to comment.