fix(web): update parseSchema api param
This commit is contained in:
@@ -99,16 +99,11 @@ const CustomToolModal = forwardRef<CustomToolModalRef, CustomToolModalProps>(({
|
|||||||
};
|
};
|
||||||
const formatSchema = (value: string) => {
|
const formatSchema = (value: string) => {
|
||||||
setParseSchemaData({} as ParseSchemaData)
|
setParseSchemaData({} as ParseSchemaData)
|
||||||
try {
|
parseSchema({ schema_content: value })
|
||||||
const json = JSON.parse(value)
|
.then(res => {
|
||||||
parseSchema({ schema_content: json })
|
const response = res as { data: ParseSchemaData }
|
||||||
.then(res => {
|
setParseSchemaData(response.data)
|
||||||
const response = res as { data: ParseSchemaData }
|
})
|
||||||
setParseSchemaData(response.data)
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.log('error', error)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暴露给父组件的方法
|
// 暴露给父组件的方法
|
||||||
|
|||||||
Reference in New Issue
Block a user