feat: add change plan functionality to OrganizationSettings component

This commit is contained in:
Usman Baig
2026-02-09 10:48:55 +01:00
parent d39f9231c0
commit 4ec68e8aaf
3 changed files with 181 additions and 21 deletions

View File

@@ -64,6 +64,19 @@ export async function cancelSubscription(params?: CancelSubscriptionParams): Pro
})
}
export interface ChangePlanParams {
plan_id: string
interval: string
limit: number
}
export async function changePlan(params: ChangePlanParams): Promise<{ ok: boolean }> {
return await billingFetch<{ ok: boolean }>('/api/billing/change-plan', {
method: 'POST',
body: JSON.stringify(params),
})
}
export interface CreateCheckoutParams {
plan_id: string
interval: string