@@ -122,7 +122,7 @@ export class AdminController extends Controller {
122122
123123 // Get ClickHouse spending for these organizations
124124 const orgIds = paymentsResult . data . map ( ( org ) => org . org_id ) ;
125- const orgIds = paymentsResult . data . map ( ( org ) => org . org_id ) ;
125+
126126 const clickhouseSpendResult = await clickhouseDb . dbQuery < {
127127 organization_id : string ;
128128 total_cost : number ;
@@ -136,7 +136,6 @@ export class AdminController extends Controller {
136136 ` ,
137137 [ ]
138138 ) ;
139- const clickhouseSpendMap = new Map < string , number > ( ) ;
140139
141140 const clickhouseSpendMap = new Map < string , number > ( ) ;
142141 if ( ! clickhouseSpendResult . error && clickhouseSpendResult . data ) {
@@ -156,7 +155,9 @@ export class AdminController extends Controller {
156155 stripeCustomerId : org . stripe_customer_id ,
157156 totalPayments : org . total_amount_received / 100 , // Convert cents to dollars
158157 clickhouseTotalSpend : clickhouseSpendMap . get ( org . org_id ) || 0 ,
159- lastPaymentDate : org . last_payment_date ? Number ( org . last_payment_date ) * 1000 : null , // Convert seconds to milliseconds
158+ lastPaymentDate : org . last_payment_date
159+ ? Number ( org . last_payment_date ) * 1000
160+ : null , // Convert seconds to milliseconds
160161 tier : org . tier || "free" ,
161162 ownerEmail : org . owner_email || "Unknown" ,
162163 } ) ) ;
@@ -1630,7 +1631,9 @@ export class AdminController extends Controller {
16301631
16311632 // Get the wallet state from the worker API using admin credentials
16321633 const workerApiUrl =
1633- process . env . HELICONE_WORKER_API || process . env . WORKER_API_URL || "https://api.helicone.ai" ;
1634+ process . env . HELICONE_WORKER_API ||
1635+ process . env . WORKER_API_URL ||
1636+ "https://api.helicone.ai" ;
16341637 const adminAccessKey = process . env . HELICONE_MANUAL_ACCESS_KEY ;
16351638
16361639 if ( ! adminAccessKey ) {
@@ -1687,7 +1690,9 @@ export class AdminController extends Controller {
16871690
16881691 // Get table data from the worker API using admin credentials
16891692 const workerApiUrl =
1690- process . env . HELICONE_WORKER_API || process . env . WORKER_API_URL || "https://api.helicone.ai" ;
1693+ process . env . HELICONE_WORKER_API ||
1694+ process . env . WORKER_API_URL ||
1695+ "https://api.helicone.ai" ;
16911696 const adminAccessKey = process . env . HELICONE_MANUAL_ACCESS_KEY ;
16921697
16931698 if ( ! adminAccessKey ) {
@@ -1697,9 +1702,9 @@ export class AdminController extends Controller {
16971702 try {
16981703 // Build query params for pagination
16991704 const params = new URLSearchParams ( ) ;
1700- if ( page !== undefined ) params . set ( ' page' , page . toString ( ) ) ;
1701- if ( pageSize !== undefined ) params . set ( ' pageSize' , pageSize . toString ( ) ) ;
1702-
1705+ if ( page !== undefined ) params . set ( " page" , page . toString ( ) ) ;
1706+ if ( pageSize !== undefined ) params . set ( " pageSize" , pageSize . toString ( ) ) ;
1707+
17031708 // Use the admin endpoint that can query any org's table data
17041709 const response = await fetch (
17051710 `${ workerApiUrl } /admin/wallet/${ orgId } /tables/${ tableName } ?${ params . toString ( ) } ` ,
0 commit comments