MCPcopy Index your code
hub / github.com/simstudioai/sim / createDefaultWorkspace

Function createDefaultWorkspace

apps/sim/app/api/workspaces/route.ts:247–265  ·  view source on GitHub ↗
(
  userId: string,
  userName: string | null | undefined,
  creationPolicy: {
    organizationId: string | null
    workspaceMode: WorkspaceMode
    billedAccountUserId: string
  }
)

Source from the content-addressed store, hash-verified

245})
246
247async 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
267interface CreateWorkspaceParams {
268 userId: string

Callers 1

route.tsFile · 0.85

Calls 1

createWorkspaceFunction · 0.70

Tested by

no test coverage detected