mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Remove email query parameter from subscription patch api
This commit is contained in:
parent
d7027109a5
commit
47d3c8c235
2 changed files with 3 additions and 2 deletions
|
@ -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: {
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue