mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 23:17:59 -05:00
fix(kb): kb-level deletion should reflect in doc level kb tags sidebar registry (#944)
This commit is contained in:
@@ -89,13 +89,12 @@ export function KnowledgeTags({ knowledgeBaseId, documentId }: KnowledgeTagsProp
|
||||
const definition = definitions.find((def) => def.tagSlot === slot)
|
||||
const currentTag = currentTags?.find((tag) => tag.slot === slot)
|
||||
|
||||
// Only include tag if the document actually has a value for it
|
||||
if (value?.trim()) {
|
||||
// Only include tag if the document has a value AND a corresponding KB tag definition exists
|
||||
if (value?.trim() && definition) {
|
||||
tags.push({
|
||||
slot,
|
||||
// Preserve existing displayName if definition is not found yet
|
||||
displayName: definition?.displayName || currentTag?.displayName || '',
|
||||
fieldType: definition?.fieldType || currentTag?.fieldType || 'text',
|
||||
displayName: definition.displayName,
|
||||
fieldType: definition.fieldType,
|
||||
value: value.trim(),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user