mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-30 16:23:31 +00:00
fix: type admin account list responses
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import { apiClient } from '../client'
|
||||
import type {
|
||||
Account,
|
||||
AccountListItem,
|
||||
CreateAccountRequest,
|
||||
UpdateAccountRequest,
|
||||
PaginatedResponse,
|
||||
@@ -53,8 +54,8 @@ export async function list(
|
||||
options?: {
|
||||
signal?: AbortSignal
|
||||
}
|
||||
): Promise<PaginatedResponse<Account>> {
|
||||
const { data } = await apiClient.get<PaginatedResponse<Account>>('/admin/accounts', {
|
||||
): Promise<PaginatedResponse<AccountListItem>> {
|
||||
const { data } = await apiClient.get<PaginatedResponse<AccountListItem>>('/admin/accounts', {
|
||||
params: {
|
||||
page,
|
||||
page_size: pageSize,
|
||||
@@ -68,7 +69,7 @@ export async function list(
|
||||
export interface AccountListWithEtagResult {
|
||||
notModified: boolean
|
||||
etag: string | null
|
||||
data: PaginatedResponse<Account> | null
|
||||
data: PaginatedResponse<AccountListItem> | null
|
||||
}
|
||||
|
||||
export interface AccountUpstreamBillingRatesWithEtagResult {
|
||||
@@ -135,7 +136,7 @@ export async function listWithEtag(
|
||||
headers['If-None-Match'] = options.etag
|
||||
}
|
||||
|
||||
const response = await apiClient.get<PaginatedResponse<Account>>('/admin/accounts', {
|
||||
const response = await apiClient.get<PaginatedResponse<AccountListItem>>('/admin/accounts', {
|
||||
params: {
|
||||
page,
|
||||
page_size: pageSize,
|
||||
|
||||
@@ -1277,6 +1277,10 @@ export interface Account {
|
||||
parent_chatgpt_account_id?: string
|
||||
}
|
||||
|
||||
// The admin account list may return this compact shape when lite=1. Detail
|
||||
// operations still use Account from /admin/accounts/:id.
|
||||
export type AccountListItem = Omit<Account, 'groups'>
|
||||
|
||||
export interface AccountSchedulerGroupScore {
|
||||
group_id?: number | null
|
||||
group_name?: string
|
||||
|
||||
Reference in New Issue
Block a user