(
userId: string,
userName: string | null | undefined,
creationPolicy: {
organizationId: string | null
workspaceMode: WorkspaceMode
billedAccountUserId: string
}
)
| 245 | }) |
| 246 | |
| 247 | async function createDefaultWorkspace( |
| 248 | userId: string, |
| 249 | userName: string | null | undefined, |
| 250 | creationPolicy: { |
| 251 | organizationId: string | null |
| 252 | workspaceMode: WorkspaceMode |
| 253 | billedAccountUserId: string |
| 254 | } |
| 255 | ) { |
| 256 | const firstName = userName?.split(' ')[0] || null |
| 257 | const workspaceName = firstName ? `${firstName}'s Workspace` : 'My Workspace' |
| 258 | return createWorkspace({ |
| 259 | userId, |
| 260 | name: workspaceName, |
| 261 | organizationId: creationPolicy.organizationId, |
| 262 | workspaceMode: creationPolicy.workspaceMode, |
| 263 | billedAccountUserId: creationPolicy.billedAccountUserId, |
| 264 | }) |
| 265 | } |
| 266 | |
| 267 | interface CreateWorkspaceParams { |
| 268 | userId: string |
no test coverage detected