2023-12-03 22:10:16 +08:00
|
|
|
import { get } from './base'
|
|
|
|
import type { CurrentPlanInfoBackend, SubscriptionUrlsBackend } from '@/app/components/billing/type'
|
|
|
|
|
|
|
|
export const fetchCurrentPlanInfo = () => {
|
2024-02-01 18:07:26 +08:00
|
|
|
return get<CurrentPlanInfoBackend>('/features')
|
2023-12-03 22:10:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export const fetchSubscriptionUrls = (plan: string, interval: string) => {
|
2024-02-01 18:07:26 +08:00
|
|
|
return get<SubscriptionUrlsBackend>(`/billing/subscription?plan=${plan}&interval=${interval}`)
|
2023-12-03 22:10:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export const fetchBillingUrl = () => {
|
2024-02-01 18:07:26 +08:00
|
|
|
return get<{ url: string }>('/billing/invoices')
|
2023-12-03 22:10:16 +08:00
|
|
|
}
|