fix(web): number type prompt variable required validation not effective (#20898)
This commit is contained in:
parent
0784c6295d
commit
b69f952e3e
1 changed files with 1 additions and 2 deletions
|
|
@ -156,12 +156,11 @@ const Debug: FC<IDebug> = ({
|
||||||
}
|
}
|
||||||
let hasEmptyInput = ''
|
let hasEmptyInput = ''
|
||||||
const requiredVars = modelConfig.configs.prompt_variables.filter(({ key, name, required, type }) => {
|
const requiredVars = modelConfig.configs.prompt_variables.filter(({ key, name, required, type }) => {
|
||||||
if (type !== 'string' && type !== 'paragraph' && type !== 'select')
|
if (type !== 'string' && type !== 'paragraph' && type !== 'select' && type !== 'number')
|
||||||
return false
|
return false
|
||||||
const res = (!key || !key.trim()) || (!name || !name.trim()) || (required || required === undefined || required === null)
|
const res = (!key || !key.trim()) || (!name || !name.trim()) || (required || required === undefined || required === null)
|
||||||
return res
|
return res
|
||||||
}) // compatible with old version
|
}) // compatible with old version
|
||||||
// debugger
|
|
||||||
requiredVars.forEach(({ key, name }) => {
|
requiredVars.forEach(({ key, name }) => {
|
||||||
if (hasEmptyInput)
|
if (hasEmptyInput)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue