From f3caba81763933c8bb3af54487607bf3a86bcfae Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 18 Dec 2024 15:24:37 +0000 Subject: [PATCH] Fix onboarding users --- .../_components/BuilderSidePanel.svelte | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index 687678c08a..b80d3137f0 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -368,20 +368,22 @@ const payload = [ { email: newUserEmail, - builder: { - global: creationRoleType === Constants.BudibaseRoles.Admin, - creator: creationRoleType === Constants.BudibaseRoles.Creator, + userInfo: { + builder: { + global: creationRoleType === Constants.BudibaseRoles.Admin, + creator: creationRoleType === Constants.BudibaseRoles.Creator, + }, + admin: { global: creationRoleType === Constants.BudibaseRoles.Admin }, }, - admin: { global: creationRoleType === Constants.BudibaseRoles.Admin }, }, ] const notCreatingAdmin = creationRoleType !== Constants.BudibaseRoles.Admin const isCreator = creationAccessType === Constants.Roles.CREATOR if (notCreatingAdmin && isCreator) { - payload[0].builder.apps = [prodAppId] + payload[0].userInfo.builder.apps = [prodAppId] } else if (notCreatingAdmin && !isCreator) { - payload[0].apps = { [prodAppId]: creationAccessType } + payload[0].userInfo.apps = { [prodAppId]: creationAccessType } } let userInviteResponse