mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Add back /api/configure as /api/settings API endpoint
It had been removed during the /api/configure/content to /api/content API migration before
This commit is contained in:
parent
3832ef0236
commit
f03525f431
1 changed files with 12 additions and 0 deletions
|
@ -40,6 +40,7 @@ from khoj.routers.helpers import (
|
|||
CommonQueryParams,
|
||||
ConversationCommandRateLimiter,
|
||||
acreate_title_from_query,
|
||||
get_user_config,
|
||||
schedule_automation,
|
||||
update_telemetry_state,
|
||||
)
|
||||
|
@ -277,6 +278,17 @@ async def transcribe(
|
|||
return Response(content=content, media_type="application/json", status_code=200)
|
||||
|
||||
|
||||
@api.get("/settings", response_class=Response)
|
||||
@requires(["authenticated"])
|
||||
def get_settings(request: Request, detailed: Optional[bool] = False) -> Response:
|
||||
user = request.user.object
|
||||
user_config = get_user_config(user, request, is_detailed=detailed)
|
||||
del user_config["request"]
|
||||
|
||||
# Return config data as a JSON response
|
||||
return Response(content=json.dumps(user_config), media_type="application/json", status_code=200)
|
||||
|
||||
|
||||
@api.patch("/user/name", status_code=200)
|
||||
@requires(["authenticated"])
|
||||
def set_user_name(
|
||||
|
|
Loading…
Add table
Reference in a new issue