diff --git a/templates/website/src/utilities/getGlobals.ts b/templates/website/src/utilities/getGlobals.ts index d37a2aa03c8..64dab5f53e0 100644 --- a/templates/website/src/utilities/getGlobals.ts +++ b/templates/website/src/utilities/getGlobals.ts @@ -6,7 +6,7 @@ import { unstable_cache } from 'next/cache' type Global = keyof Config['globals'] -async function getGlobal(slug: Global, depth = 0) { +async function getGlobal(slug: T, depth = 0) { const payload = await getPayload({ config: configPromise }) const global = await payload.findGlobal({ @@ -20,7 +20,7 @@ async function getGlobal(slug: Global, depth = 0) { /** * Returns a unstable_cache function mapped with the cache tag for the slug */ -export const getCachedGlobal = (slug: Global, depth = 0) => +export const getCachedGlobal = (slug: T, depth = 0) => unstable_cache(async () => getGlobal(slug, depth), [slug], { tags: [`global_${slug}`], })