mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Remove email query parameter from subscription patch api
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user