fix: bing search response filter (#2519)

This commit is contained in:
Yeuoly
2024-02-22 13:06:55 +08:00
committed by GitHub
parent 1ecbd95adf
commit d8ab4474b4
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