billing.ts 495 B

1234567891011121314
  1. import { get } from './base'
  2. import type { CurrentPlanInfoBackend, SubscriptionUrlsBackend } from '@/app/components/billing/type'
  3. export const fetchCurrentPlanInfo = () => {
  4. return get<CurrentPlanInfoBackend>('/features')
  5. }
  6. export const fetchSubscriptionUrls = (plan: string, interval: string) => {
  7. return get<SubscriptionUrlsBackend>(`/billing/subscription?plan=${plan}&interval=${interval}`)
  8. }
  9. export const fetchBillingUrl = () => {
  10. return get<{ url: string }>('/billing/invoices')
  11. }