diff options
| author | Frank <[email protected]> | 2025-11-16 03:29:49 -0500 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-11-16 03:29:52 -0500 |
| commit | 0e12dd62a3a4af8d00c0d1d5a445f0071bef47ab (patch) | |
| tree | 0a7aeaa74f8d01dca94450b96bba93fecff22a7b /packages/console/core/src | |
| parent | 2b957b5d1ce45c2413e39869a0ce9f3c81ea80fe (diff) | |
| download | opencode-0e12dd62a3a4af8d00c0d1d5a445f0071bef47ab.tar.gz opencode-0e12dd62a3a4af8d00c0d1d5a445f0071bef47ab.zip | |
zen: usage paging
Diffstat (limited to 'packages/console/core/src')
| -rw-r--r-- | packages/console/core/src/billing.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/console/core/src/billing.ts b/packages/console/core/src/billing.ts index 348718146..049ee29bb 100644 --- a/packages/console/core/src/billing.ts +++ b/packages/console/core/src/billing.ts @@ -57,14 +57,15 @@ export namespace Billing { ) } - export const usages = async () => { + export const usages = async (page = 0, pageSize = 50) => { return await Database.use((tx) => tx .select() .from(UsageTable) .where(eq(UsageTable.workspaceID, Actor.workspace())) .orderBy(sql`${UsageTable.timeCreated} DESC`) - .limit(100), + .limit(pageSize) + .offset(page * pageSize), ) } |
