From 3832ef023692c44dfe8a74171f627a10aaa72850 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 19 Jul 2024 02:28:58 +0530 Subject: [PATCH] Move API endpoints under /api/configure/phone/ to /api/phone/ Pull out /api/configure/phone API endpoints into /api/phone for more concise and sufficiently explanatory API path Refactor Flow 1. Rename /api/configure/phone -> /api/phone --- src/khoj/configure.py | 2 +- src/khoj/interface/web/settings.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 5dfb1457..a77ade87 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -336,7 +336,7 @@ def configure_routes(app): if is_twilio_enabled(): from khoj.routers.api_phone import api_phone - app.include_router(api_phone, prefix="/api/configure/phone") + app.include_router(api_phone, prefix="/api/phone") logger.info("📞 Enabled Twilio") diff --git a/src/khoj/interface/web/settings.html b/src/khoj/interface/web/settings.html index f515e371..7025773d 100644 --- a/src/khoj/interface/web/settings.html +++ b/src/khoj/interface/web/settings.html @@ -890,7 +890,7 @@ }) phonenumberRemoveButton.addEventListener("click", () => { - fetch('/api/configure/phone', { + fetch('/api/phone', { method: 'DELETE', headers: { 'Content-Type': 'application/json', @@ -917,7 +917,7 @@ }, 5000); } else { const mobileNumber = iti.getNumber(); - fetch('/api/configure/phone?phone_number=' + mobileNumber, { + fetch('/api/phone?phone_number=' + mobileNumber, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -970,7 +970,7 @@ return; } - fetch('/api/configure/phone/verify?code=' + otp, { + fetch('/api/phone/verify?code=' + otp, { method: 'POST', headers: { 'Content-Type': 'application/json',