diff --git a/src/interface/web/app/settings/page.tsx b/src/interface/web/app/settings/page.tsx index bab7df32..6819e7c0 100644 --- a/src/interface/web/app/settings/page.tsx +++ b/src/interface/web/app/settings/page.tsx @@ -594,7 +594,7 @@ export default function SettingsView() { const setSubscription = async (state: string) => { try { - const url = `/api/subscription?email=${userConfig?.username}&operation=${state}`; + const url = `/api/subscription?operation=${state}`; const response = await fetch(url, { method: "PATCH", headers: { diff --git a/src/khoj/routers/api_subscription.py b/src/khoj/routers/api_subscription.py index f47775aa..4bb4f63e 100644 --- a/src/khoj/routers/api_subscription.py +++ b/src/khoj/routers/api_subscription.py @@ -94,8 +94,9 @@ async def subscribe(request: Request): @subscription_router.patch("") @requires(["authenticated"]) -async def update_subscription(request: Request, email: str, operation: str): +async def update_subscription(request: Request, operation: str): # Retrieve the customer's details + email = request.user.object.email customers = stripe.Customer.list(email=email).auto_paging_iter() customer = next(customers, None) if customer is None: