feat: implement loading state and error handling in PricingSection; add Suspense for async components in Pricing and Settings pages
This commit is contained in:
@@ -45,3 +45,16 @@ export async function createPortalSession(): Promise<{ url: string }> {
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
export interface CreateCheckoutParams {
|
||||
plan_id: string
|
||||
interval: string
|
||||
limit: number
|
||||
}
|
||||
|
||||
export async function createCheckoutSession(params: CreateCheckoutParams): Promise<{ url: string }> {
|
||||
return await billingFetch<{ url: string }>('/api/billing/checkout', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(params),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user