mirror of https://github.com/langgenius/dify.git
add description length check
This commit is contained in:
parent
874406d934
commit
d2f12037da
|
|
@ -235,11 +235,13 @@ const ChatVariableModal = ({
|
|||
return
|
||||
if (!chatVar && varList.some(chatVar => chatVar.name === name))
|
||||
return notify({ type: 'error', message: 'name is existed' })
|
||||
// if (type !== ChatVarType.Object && !value)
|
||||
// return notify({ type: 'error', message: 'value can not be empty' })
|
||||
|
||||
if (type === ChatVarType.Object && objectValue.some(item => !item.key && !!item.value))
|
||||
return notify({ type: 'error', message: 'object key can not be empty' })
|
||||
|
||||
if (description.length > 256)
|
||||
return notify({ type: 'error', message: 'description can not be longer than 256 characters' })
|
||||
|
||||
onSave({
|
||||
id: chatVar ? chatVar.id : uuid4(),
|
||||
name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue