mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-19 05:05:53 +08:00
fix: change to key value type not show init key values
This commit is contained in:
parent
2a6629d435
commit
dae62bef78
@ -63,9 +63,19 @@ const EditBody: FC<Props> = ({
|
||||
|
||||
const handleTypeChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const newType = e.target.value as BodyType
|
||||
const hasKeyValue = [BodyType.formData, BodyType.xWwwFormUrlencoded].includes(newType)
|
||||
onChange({
|
||||
type: newType,
|
||||
data: [],
|
||||
data: hasKeyValue
|
||||
? [
|
||||
{
|
||||
id: uniqueId(UNIQUE_ID_PREFIX),
|
||||
type: BodyPayloadValueType.text,
|
||||
key: '',
|
||||
value: '',
|
||||
},
|
||||
]
|
||||
: [],
|
||||
})
|
||||
}, [onChange])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user