From fa205cba3711de18b31634573b87c915c3808714 Mon Sep 17 00:00:00 2001 From: hj24 Date: Mon, 26 Jan 2026 15:00:22 +0800 Subject: [PATCH] fix: account deletion api --- api/services/billing_service.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/services/billing_service.py b/api/services/billing_service.py index 26ce8cad33..f80e72b708 100644 --- a/api/services/billing_service.py +++ b/api/services/billing_service.py @@ -143,6 +143,14 @@ class BillingService: raise ValueError("Invalid arguments.") if method == "POST" and response.status_code != httpx.codes.OK: raise ValueError(f"Unable to send request to {url}. Please try again later or contact support.") + if method == "DELETE" and response.status_code != httpx.codes.OK: + logger.error( + "billing_service: %s _send_request: response: %s %s", method, response.status_code, response.text + ) + raise ValueError(f"Unable to process delete request {url}. Please try again later or contact support.") + logger.info( + "billing_service: %s _send_request: response: %s %s", method, response.status_code, response.text + ) return response.json() @staticmethod @@ -165,7 +173,7 @@ class BillingService: def delete_account(cls, account_id: str): """Delete account.""" params = {"account_id": account_id} - return cls._send_request("DELETE", "/account/", params=params) + return cls._send_request("DELETE", "/account", params=params) @classmethod def is_email_in_freeze(cls, email: str) -> bool: