summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/src/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/core/src/user.ts')
-rw-r--r--packages/console/core/src/user.ts28
1 files changed, 23 insertions, 5 deletions
diff --git a/packages/console/core/src/user.ts b/packages/console/core/src/user.ts
index 8b7a96f44..cbb1ac827 100644
--- a/packages/console/core/src/user.ts
+++ b/packages/console/core/src/user.ts
@@ -26,7 +26,10 @@ export namespace User {
authEmail: AuthTable.subject,
})
.from(UserTable)
- .leftJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")))
+ .leftJoin(
+ AuthTable,
+ and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")),
+ )
.where(and(eq(UserTable.workspaceID, Actor.workspace()), isNull(UserTable.timeDeleted))),
),
)
@@ -36,7 +39,13 @@ export namespace User {
tx
.select()
.from(UserTable)
- .where(and(eq(UserTable.workspaceID, Actor.workspace()), eq(UserTable.id, id), isNull(UserTable.timeDeleted)))
+ .where(
+ and(
+ eq(UserTable.workspaceID, Actor.workspace()),
+ eq(UserTable.id, id),
+ isNull(UserTable.timeDeleted),
+ ),
+ )
.then((rows) => rows[0]),
),
)
@@ -48,7 +57,10 @@ export namespace User {
email: AuthTable.subject,
})
.from(UserTable)
- .leftJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")))
+ .leftJoin(
+ AuthTable,
+ and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")),
+ )
.where(and(eq(UserTable.workspaceID, Actor.workspace()), eq(UserTable.id, id)))
.then((rows) => rows[0]?.email),
),
@@ -130,10 +142,16 @@ export namespace User {
workspaceName: WorkspaceTable.name,
})
.from(UserTable)
- .innerJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")))
+ .innerJoin(
+ AuthTable,
+ and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")),
+ )
.innerJoin(WorkspaceTable, eq(WorkspaceTable.id, workspaceID))
.where(
- and(eq(UserTable.workspaceID, workspaceID), eq(UserTable.id, Actor.assert("user").properties.userID)),
+ and(
+ eq(UserTable.workspaceID, workspaceID),
+ eq(UserTable.id, Actor.assert("user").properties.userID),
+ ),
)
.then((rows) => rows[0]),
)