church-website/src/fetch/footer.ts
2026-03-11 11:29:16 +01:00

13 lines
381 B
TypeScript

import { unstable_cache } from 'next/cache'
import { getPayload } from 'payload'
import config from '@/payload.config'
import { Footer } from '@/payload-types'
export const fetchFooter = unstable_cache(
async (): Promise<Footer> => {
const payload = await getPayload({ config })
return payload.findGlobal({ slug: 'footer' })
},
['footer'],
{ tags: ['footer'] },
)