Skip to content

Commit

Permalink
馃┕ Patch 4 - Fix guest invitation with new console documentation (#2791)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomaricMourgues authored and Labels Bot committed Apr 5, 2023
1 parent 06f5327 commit 0770da3
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions twake/backend/node/src/services/console/clients/remote.ts
Expand Up @@ -57,15 +57,28 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {

if (user.skipInvite && user.name && user.email && user.password) {
return this.client
.post(`/api/companies/${company.code}/users`, user, {
auth: this.auth(),
headers: {
"Content-Type": "application/json",
.post(
`/api/companies/${company.code}/users`,
{
...user,
...(isNewConsole
? {
name: user.lastName ? user.firstName : user.name,
surname: user.lastName,
applicationCodes: ["twake"],
}
: {}),
},
params: {
skipInvite: user.skipInvite,
{
auth: this.auth(),
headers: {
"Content-Type": "application/json",
},
params: {
skipInvite: user.skipInvite,
},
},
})
)
.then(({ data }) => data);
} else {
const invitationData = {
Expand Down

0 comments on commit 0770da3

Please sign in to comment.