Skip to content

Commit

Permalink
Remove email query parameter from subscription patch api
Browse files Browse the repository at this point in the history
  • Loading branch information
sabaimran committed Nov 12, 2024
1 parent d702710 commit 47d3c8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interface/web/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
3 changes: 2 additions & 1 deletion src/khoj/routers/api_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 47d3c8c

Please sign in to comment.