fp/services/next/app/profile/hooks/patreonCurrentlyEntitledTie...

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
}