diff --git a/next-enterprise/src/sanity/client.ts b/next-enterprise/src/sanity/client.ts index 7858942..7d5dd00 100644 --- a/next-enterprise/src/sanity/client.ts +++ b/next-enterprise/src/sanity/client.ts @@ -3,6 +3,6 @@ import {createClient} from '@sanity/client' export const client = createClient({ projectId: 'hiomol4a', dataset: 'lcapi', - apiVersion: '2024-09-19', + apiVersion: '2024-09-20', useCdn: false, }) diff --git a/next-enterprise/src/sanity/fetch.ts b/next-enterprise/src/sanity/fetch.ts index 7977e99..abacd69 100644 --- a/next-enterprise/src/sanity/fetch.ts +++ b/next-enterprise/src/sanity/fetch.ts @@ -8,11 +8,11 @@ export async function sanityFetch({ query: QueryString params?: QueryParams }) { + // Uncached query that fetches cache tags (on Next 15 uncached doesn't mean on every browser request, but on every ISR build) const {syncTags: tags} = await client.fetch(query, params, { filterResponse: false, - returnQuery: false, + tag: 'fetch-sync-tags', // The request tag makes the fetch unique, avoids deduping with the cached query that has tags }) - const {result, syncTags} = await client.fetch(query, params, {next: {tags}}) - - return {data: result, tags: syncTags, fetchedAt: new Date().toJSON()} + const data = await client.fetch(query, params, {next: {tags}}) + return {data, tags, fetchedAt: new Date().toJSON()} }