fix: reenable member invites

This commit is contained in:
Henry
2025-05-22 12:18:56 +01:00
parent 82ec18e95e
commit 71c92eea27
16 changed files with 2183 additions and 231 deletions

View File

@@ -1,4 +1,5 @@
import { eq } from "drizzle-orm";
import { v4 as uuidv4 } from "uuid";
import type { dbClient } from "@kan/db/client";
import { users } from "@kan/db/schema";
@@ -29,12 +30,12 @@ export const getByEmail = (db: dbClient, email: string) => {
export const create = async (
db: dbClient,
user: { id: string; email: string; stripeCustomerId: string },
user: { id?: string; email: string; stripeCustomerId?: string },
) => {
const [result] = await db
.insert(users)
.values({
id: user.id,
id: user.id ?? uuidv4(),
email: user.email,
stripeCustomerId: user.stripeCustomerId,
emailVerified: false,