fix(web): model bugfix

This commit is contained in:
zhaoying
2026-01-29 14:51:27 +08:00
parent 537be81b8f
commit 5b9adb799f
3 changed files with 7 additions and 5 deletions

View File

@@ -44,7 +44,8 @@ const CustomModelModal = forwardRef<CustomModelModalRef, CustomModelModalProps>(
};
const handleUpdate = (data: CustomModelForm) => {
setLoading(true)
const res = isEdit ? updateCustomModel(model.id, data) : addCustomModel(data)
const { type, provider, ...rest} = data
const res = isEdit ? updateCustomModel(model.id, rest) : addCustomModel(data)
res.then(() => {
refresh && refresh()

View File

@@ -75,8 +75,9 @@ const GroupModelModal = forwardRef<GroupModelModalRef, GroupModelModalProps>(({
const handleUpdate = (data: CompositeModelForm) => {
setLoading(true)
const { type, ...rest } = data
const res = isEdit
? updateCompositeModel(model.id, data)
? updateCompositeModel(model.id, { ...rest })
: addCompositeModel(data)
res.then(() => {

View File

@@ -17,7 +17,7 @@ export interface DescriptionItem {
export interface CompositeModelForm {
logo?: any;
name: string;
type: string;
type?: string;
description: string;
api_key_ids: ModelApiKey[] | string[];
}
@@ -119,8 +119,8 @@ export interface ModelSquareDetailRef {
}
export interface CustomModelForm {
name: string;
type: string;
provider: string;
type?: string;
provider?: string;
logo?: any;
description: string;
is_official: boolean;