This commit is contained in:
Frank
2025-10-03 07:45:35 -04:00
parent aae387f7dc
commit 1d58b55482
3 changed files with 19 additions and 25 deletions

View File

@@ -50,6 +50,19 @@ export namespace User {
),
)
export const getAccountEmail = fn(z.string(), (id) =>
Database.use((tx) =>
tx
.select({
email: AccountTable.email,
})
.from(UserTable)
.leftJoin(AccountTable, eq(UserTable.accountID, AccountTable.id))
.where(and(eq(UserTable.workspaceID, Actor.workspace()), eq(UserTable.id, id)))
.then((rows) => rows[0]?.email),
),
)
export const invite = fn(
z.object({
email: z.string(),