Skip to content

Commit f7ef7a6

Browse files
authored
fix invitation error (#2361)
1 parent 12793db commit f7ef7a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/src/routes/api/auth/workos/webhooks.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ export const Route = createFileRoute('/api/auth/workos/webhooks')({
7474
}
7575

7676
if (userInvitations.length > 0) {
77-
const orgDetails = await getOrganisationDetails(orgId);
78-
let orgName = orgDetails.name;
7977
for (const invitation of userInvitations) {
78+
const orgDetails = await getOrganisationDetails(invitation.organizationId!);
79+
let orgName = orgDetails.name;
80+
console.log(`Syncing organization ${orgName} to backend and statesman`);
8081
try {
8182
await syncOrgToBackend(invitation.organizationId!, orgName, null);
8283
await syncOrgToStatesman(invitation.organizationId!, orgName, personalOrgDisplayName, invitation.userId!, invitation.userEmail!);

0 commit comments

Comments
 (0)