Add signup trial que crea tenant y owner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Carlos Narro
2026-05-30 19:50:50 +02:00
parent aecfb2c7e3
commit 795d6a7a19
3 changed files with 76 additions and 0 deletions

View File

@@ -45,3 +45,8 @@ export async function createTenantWithOwner(input: {
return { tenant, user };
}
export async function slugDisponible(slug: string): Promise<boolean> {
const [row] = await db.select({ id: tenants.id }).from(tenants).where(eq(tenants.slug, slug)).limit(1);
return !row;
}