feat: create workspace on successful activation

This commit is contained in:
Henry
2026-04-10 15:28:27 +01:00
parent 6dfee580f7
commit cb76926041
6 changed files with 96 additions and 38 deletions

View File

@@ -64,6 +64,8 @@ export const create = async (
slug: string;
createdBy: string;
createdByEmail: string;
description?: string;
plan?: "free" | "team" | "pro" | "enterprise";
},
) => {
const [workspace] = await db
@@ -73,6 +75,8 @@ export const create = async (
name: workspaceInput.name,
slug: workspaceInput.slug,
createdBy: workspaceInput.createdBy,
...(workspaceInput.description && { description: workspaceInput.description }),
...(workspaceInput.plan && { plan: workspaceInput.plan }),
})
.returning({
id: workspaces.id,