Files
portal/app/resources/js/api/public.ts
T
Дмитрий 146174a2e2
Accessibility (Pa11y live) / a11y (push) Has been cancelled
SAST — Semgrep / Semgrep SAST scan (push) Has been cancelled
feat: публичные юр-страницы оферта/политика/возврат + реквизиты + страница цен под модерацию ЮKassa
2026-06-24 09:31:52 +03:00

16 lines
572 B
TypeScript

/**
* Публичные (без auth) API-вызовы: тарифная сетка для страницы цен.
*/
export interface PricingTierDto {
tier_no: number;
leads_in_tier: number | null;
price_rub: string;
}
export async function fetchPublicPricing(): Promise<PricingTierDto[]> {
const res = await fetch('/api/public/pricing', { headers: { Accept: 'application/json' } });
if (!res.ok) throw new Error(`pricing fetch failed: ${res.status}`);
const data = (await res.json()) as { tiers: PricingTierDto[] };
return data.tiers;
}