fix(web): model bugfix
This commit is contained in:
@@ -44,7 +44,8 @@ const CustomModelModal = forwardRef<CustomModelModalRef, CustomModelModalProps>(
|
|||||||
};
|
};
|
||||||
const handleUpdate = (data: CustomModelForm) => {
|
const handleUpdate = (data: CustomModelForm) => {
|
||||||
setLoading(true)
|
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(() => {
|
res.then(() => {
|
||||||
refresh && refresh()
|
refresh && refresh()
|
||||||
|
|||||||
@@ -75,8 +75,9 @@ const GroupModelModal = forwardRef<GroupModelModalRef, GroupModelModalProps>(({
|
|||||||
|
|
||||||
const handleUpdate = (data: CompositeModelForm) => {
|
const handleUpdate = (data: CompositeModelForm) => {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
|
const { type, ...rest } = data
|
||||||
const res = isEdit
|
const res = isEdit
|
||||||
? updateCompositeModel(model.id, data)
|
? updateCompositeModel(model.id, { ...rest })
|
||||||
: addCompositeModel(data)
|
: addCompositeModel(data)
|
||||||
|
|
||||||
res.then(() => {
|
res.then(() => {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export interface DescriptionItem {
|
|||||||
export interface CompositeModelForm {
|
export interface CompositeModelForm {
|
||||||
logo?: any;
|
logo?: any;
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type?: string;
|
||||||
description: string;
|
description: string;
|
||||||
api_key_ids: ModelApiKey[] | string[];
|
api_key_ids: ModelApiKey[] | string[];
|
||||||
}
|
}
|
||||||
@@ -119,8 +119,8 @@ export interface ModelSquareDetailRef {
|
|||||||
}
|
}
|
||||||
export interface CustomModelForm {
|
export interface CustomModelForm {
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type?: string;
|
||||||
provider: string;
|
provider?: string;
|
||||||
logo?: any;
|
logo?: any;
|
||||||
description: string;
|
description: string;
|
||||||
is_official: boolean;
|
is_official: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user