fix: bing search response filter (#2519)

This commit is contained in:
Yeuoly 2024-02-22 13:06:55 +08:00 committed by GitHub
commit d8ab4474b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 170 additions and 23 deletions

View file

@ -57,7 +57,7 @@ export const addDefaultValue = (value: Record<string, any>, formSchemas: { varia
const newValues = { ...value }
formSchemas.forEach((formSchema) => {
const itemValue = value[formSchema.variable]
if (formSchema.default && (value === undefined || itemValue === null || itemValue === ''))
if ((formSchema.default !== undefined) && (value === undefined || itemValue === null || itemValue === '' || itemValue === undefined))
newValues[formSchema.variable] = formSchema.default
})
return newValues