fix(web): model bugfix
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user