feat(admin): show user subscription plan and token quota in user pages
Expose active subscription summary on user list and detail so operators can see plan type, total/used/remaining tokens without opening billing subscriptions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-3
@@ -877,9 +877,11 @@ export async function listAdminUsers(params?: {
|
||||
return { items: result.users ?? [], total, page: result.page ?? 1, pageSize, totalPages: Math.ceil(total / pageSize) };
|
||||
}
|
||||
|
||||
export async function getAdminUser(userId: string): Promise<PortalUser> {
|
||||
const result = await portalFetch<{ user: PortalUser }>(`/admin-api/users/${userId}`);
|
||||
return result.user;
|
||||
export async function getAdminUser(userId: string): Promise<{ user: PortalUser; subscription: AdminSubscription | null }> {
|
||||
const result = await portalFetch<{ user: PortalUser; subscription?: AdminSubscription | null }>(
|
||||
`/admin-api/users/${userId}`,
|
||||
);
|
||||
return { user: result.user, subscription: result.subscription ?? null };
|
||||
}
|
||||
|
||||
export async function createAdminUser(payload: {
|
||||
|
||||
Reference in New Issue
Block a user