fp/services/next/app/profile/hooks/patreonCurrentlyEntitledTiers.ts
CJ_Clippy 5e83742341
Some checks failed
ci / build (push) Failing after 1s
create migrations-data
2024-12-16 12:39:23 -08:00

17 lines
437 B
TypeScript

import { TiersList } from "@/app/lib/patreon"
export async function fetchPatreonCurrentlyEntitledTiers (): Promise<TiersList> {
const response = await fetch(`/api/patreon/currently-entitled-tiers`, {
credentials: 'include'
})
const data = await response.json()
if (!response.ok) {
throw new Error(`failed to fetchPatreonCurrentlyEntitledTiers() res.status=${response.status}`)
}
console.log(data)
return data
}