Skip to content

Commit 76eaada

Browse files
authored
[dashboard] Ensure we always send an organizationId if we need to! (#16993)
1 parent c5efa71 commit 76eaada

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

components/dashboard/src/workspaces/CreateWorkspacePage.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,18 @@ export function CreateWorkspacePage() {
122122
return;
123123
}
124124

125+
const organizationId = currentOrg?.id;
126+
console.log("organizationId: " + JSON.stringify(organizationId));
127+
if (!organizationId && !!user?.additionalData?.isMigratedToTeamOnlyAttribution) {
128+
// We need an organizationId for this group of users
129+
console.warn("Skipping createWorkspace");
130+
return;
131+
}
132+
125133
try {
126134
const result = await createWorkspaceMutation.mutateAsync({
127135
contextUrl: contextURL,
128-
organizationId: currentOrg?.id,
136+
organizationId,
129137
...opts,
130138
});
131139
if (result.workspaceURL) {
@@ -139,7 +147,7 @@ export function CreateWorkspacePage() {
139147
console.log(error);
140148
}
141149
},
142-
[createWorkspaceMutation, history, contextURL, selectedIde, selectedWsClass, currentOrg?.id, useLatestIde],
150+
[createWorkspaceMutation, history, contextURL, selectedIde, selectedWsClass, currentOrg?.id, user?.additionalData?.isMigratedToTeamOnlyAttribution, useLatestIde],
143151
);
144152

145153
// Need a wrapper here so we call createWorkspace w/o any arguments

0 commit comments

Comments
 (0)