mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +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) => {
|
const setSubscription = async (state: string) => {
|
||||||
try {
|
try {
|
||||||
const url = `/api/subscription?email=${userConfig?.username}&operation=${state}`;
|
const url = `/api/subscription?operation=${state}`;
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -94,8 +94,9 @@ async def subscribe(request: Request):
|
||||||
|
|
||||||
@subscription_router.patch("")
|
@subscription_router.patch("")
|
||||||
@requires(["authenticated"])
|
@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
|
# Retrieve the customer's details
|
||||||
|
email = request.user.object.email
|
||||||
customers = stripe.Customer.list(email=email).auto_paging_iter()
|
customers = stripe.Customer.list(email=email).auto_paging_iter()
|
||||||
customer = next(customers, None)
|
customer = next(customers, None)
|
||||||
if customer is None:
|
if customer is None:
|
||||||
|
|
Loading…
Reference in a new issue