mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 05:40:17 +00:00
Fix to return only enabled content types via the new config/types API
- Previously was return all core content types even if they had not been setup - Add test to validate only configured content types are returned by the api/config/types API endpoint
This commit is contained in:
@@ -32,7 +32,7 @@ def get_config_types():
|
||||
return [
|
||||
search_type.value
|
||||
for search_type in SearchType
|
||||
if any(search_type.value == configured_content_type[0] for configured_content_type in state.config.content_type)
|
||||
if any(search_type.value == ctype[0] and ctype[1] for ctype in state.config.content_type)
|
||||
or search_type.name in state.config.content_type.plugins.keys()
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user