16 lines
341 B
TypeScript
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()
|
|
}
|