feat: Implement knowledge tag management and batch updates for FAQ entries
- Added API functions for listing, creating, updating, and deleting knowledge base tags. - Introduced batch update functionality for enabling/disabling FAQ entries and updating their tags. - Enhanced the KnowledgeBase.vue and FAQEntryManager.vue components to support tag management and batch operations. - Updated localization files to include new strings related to tag management and batch operations.
This commit is contained in:
@@ -97,6 +97,14 @@ func (r *knowledgeRepository) UpdateKnowledge(ctx context.Context, knowledge *ty
|
||||
return err
|
||||
}
|
||||
|
||||
// UpdateKnowledgeBatch updates knowledge items in batch
|
||||
func (r *knowledgeRepository) UpdateKnowledgeBatch(ctx context.Context, knowledgeList []*types.Knowledge) error {
|
||||
if len(knowledgeList) == 0 {
|
||||
return nil
|
||||
}
|
||||
return r.db.WithContext(ctx).Save(knowledgeList).Error
|
||||
}
|
||||
|
||||
// DeleteKnowledge deletes knowledge
|
||||
func (r *knowledgeRepository) DeleteKnowledge(ctx context.Context, tenantID uint, id string) error {
|
||||
return r.db.WithContext(ctx).Where("tenant_id = ? AND id = ?", tenantID, id).Delete(&types.Knowledge{}).Error
|
||||
|
||||
Reference in New Issue
Block a user