Refactor subscription and order retrieval methods

The changes refactor how subscription and order data is retrieved throughout the codebase. This includes renaming methods from 'getSubscriptionData' and 'getOrdersData' to 'getSubscription' and 'getOrder' respectively. The code for obtaining these subscriptions and orders has been rewritten for improved clarity and error handling.
This commit is contained in:
giancarlo
2024-04-24 12:07:09 +07:00
parent abd0771c4a
commit dbdccc59bc
4 changed files with 74 additions and 32 deletions

View File

@@ -36,8 +36,8 @@ export const loadPersonalAccountBillingPageData = cache((userId: string) => {
const data =
BILLING_MODE === 'subscription'
? api.getSubscriptionData(userId)
: api.getOrdersData(userId);
? api.getSubscription(userId)
: api.getOrder(userId);
const customerId = api.getBillingCustomerId(userId);

View File

@@ -28,8 +28,8 @@ export const loadTeamAccountBillingPage = cache((accountId: string) => {
const data =
BILLING_MODE === 'subscription'
? api.getSubscriptionData(accountId)
: api.getOrdersData(accountId);
? api.getSubscription(accountId)
: api.getOrder(accountId);
const customerId = api.getBillingCustomerId(accountId);