mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
feat(group): 支持自定义 /v1/models 模型列表
This commit is contained in:
@@ -76,6 +76,23 @@ export async function getById(id: number): Promise<AdminGroup> {
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Get candidate models for custom /v1/models list.
|
||||
* id=0 returns platform default models for create flow.
|
||||
*/
|
||||
export async function getModelsListCandidates(
|
||||
id: number,
|
||||
platform?: GroupPlatform
|
||||
): Promise<string[]> {
|
||||
const { data } = await apiClient.get<{ models: string[] }>(
|
||||
`/admin/groups/${id}/models-list-candidates`,
|
||||
{
|
||||
params: platform ? { platform } : undefined
|
||||
}
|
||||
)
|
||||
return data.models || []
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new group
|
||||
* @param groupData - Group data
|
||||
@@ -306,6 +323,7 @@ export const groupsAPI = {
|
||||
getAll,
|
||||
getByPlatform,
|
||||
getById,
|
||||
getModelsListCandidates,
|
||||
create,
|
||||
update,
|
||||
delete: deleteGroup,
|
||||
|
||||
Reference in New Issue
Block a user