feat: Implement wiki_config updates in knowledge base management
Added functionality to enable updates for the `wiki_config` field in the `KnowledgeBaseConfig` struct. This includes: 1. **Type Definition Update**: Added `WikiConfig` field to `KnowledgeBaseConfig` to allow JSON unmarshaling during update requests. 2. **Service Layer Enhancement**: Updated the `UpdateKnowledgeBase` method to persist changes to `wiki_config` when provided in the request. 3. **Frontend TypeScript Adjustments**: Enhanced type definitions in the frontend to support `wiki_config`, improving IDE autocomplete and type checking. This fix addresses the critical issue where `wiki_config` was not being updated due to its absence in the `KnowledgeBaseConfig` struct, ensuring proper handling of wiki configurations during knowledge base updates.
This commit is contained in:
@@ -53,8 +53,8 @@ func (h *WikiPageHandler) validateWikiKB(c *gin.Context) (string, uint64, error)
|
||||
return "", 0, errors.NewNotFoundError("Knowledge base not found")
|
||||
}
|
||||
|
||||
if kb.Type != types.KnowledgeBaseTypeWiki {
|
||||
return "", 0, errors.NewBadRequestError("Knowledge base is not a wiki type")
|
||||
if !kb.IsWikiEnabled() {
|
||||
return "", 0, errors.NewBadRequestError("Wiki feature is not enabled for this knowledge base")
|
||||
}
|
||||
|
||||
return kbID, tenantID, nil
|
||||
@@ -62,7 +62,7 @@ func (h *WikiPageHandler) validateWikiKB(c *gin.Context) (string, uint64, error)
|
||||
|
||||
// getSlugParam extracts and cleans the slug from gin's wildcard path param
|
||||
func getSlugParam(c *gin.Context) string {
|
||||
slug := getSlugParam(c)
|
||||
slug := c.Param("slug")
|
||||
// gin wildcard params include a leading "/"
|
||||
slug = strings.TrimPrefix(slug, "/")
|
||||
return strings.TrimSpace(slug)
|
||||
|
||||
Reference in New Issue
Block a user