File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -89,13 +89,12 @@ export function KnowledgeTags({ knowledgeBaseId, documentId }: KnowledgeTagsProp
8989 const definition = definitions . find ( ( def ) => def . tagSlot === slot )
9090 const currentTag = currentTags ?. find ( ( tag ) => tag . slot === slot )
9191
92- // Only include tag if the document actually has a value for it
93- if ( value ?. trim ( ) ) {
92+ // Only include tag if the document has a value AND a corresponding KB tag definition exists
93+ if ( value ?. trim ( ) && definition ) {
9494 tags . push ( {
9595 slot,
96- // Preserve existing displayName if definition is not found yet
97- displayName : definition ?. displayName || currentTag ?. displayName || '' ,
98- fieldType : definition ?. fieldType || currentTag ?. fieldType || 'text' ,
96+ displayName : definition . displayName ,
97+ fieldType : definition . fieldType ,
9998 value : value . trim ( ) ,
10099 } )
101100 }
You can’t perform that action at this time.
0 commit comments