Skip to content

Commit 8da8906

Browse files
committed
wip: zen
1 parent 2105373 commit 8da8906

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/console/core/script/lookup-user.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (!identifier) {
1414
if(identifier.startsWith("wrk_")){
1515
awaitprintWorkspace(identifier)
1616
}else{
17-
constauthData=awaitprintTable("Email",(tx)=>
17+
constauthData=awaitDatabase.use(async(tx)=>
1818
tx.select().from(AuthTable).where(eq(AuthTable.subject,identifier)),
1919
)
2020
if(authData.length===0){
@@ -25,7 +25,7 @@ if (identifier.startsWith("wrk_")) {
2525

2626
// Get all auth records for email
2727
constaccountID=authData[0].accountID
28-
awaitprintTable("Auth Records",(tx)=>tx.select().from(AuthTable).where(eq(AuthTable.accountID,accountID)))
28+
awaitprintTable("Auth",(tx)=>tx.select().from(AuthTable).where(eq(AuthTable.accountID,accountID)))
2929

3030
// Get all workspaces for this account
3131
constusers=awaitprintTable("Workspaces",(tx)=>
@@ -60,6 +60,7 @@ async function printWorkspace(workspaceID: string) {
6060
tx
6161
.select({
6262
balance: BillingTable.balance,
63+
customerID: BillingTable.customerID,
6364
})
6465
.from(BillingTable)
6566
.where(eq(BillingTable.workspaceID,workspace.id))
@@ -113,7 +114,7 @@ async function printWorkspace(workspaceID: string) {
113114
.from(UsageTable)
114115
.where(eq(UsageTable.workspaceID,workspace.id))
115116
.orderBy(sql`${UsageTable.timeCreated} DESC`)
116-
.limit(1000)
117+
.limit(10)
117118
.then((rows)=>
118119
rows.map((row)=>({
119120
...row,

0 commit comments

Comments
 (0)