church-website/src/fetch/siteConfig.ts
2026-03-06 15:37:10 +01:00

16 lines
341 B
TypeScript

import { SiteConfig } from '@/payload-types'
export async function fetchSiteConfig(): Promise<SiteConfig> {
const res = await fetch(
'http://localhost:3000/api/globals/site-config',
{
next: { tags: ['site-config'] },
},
)
if (!res.ok) {
throw new Error('Could not fetch site-config')
}
return res.json()
}