Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 21, 2024
1 parent 3a579cc commit 5eb1e1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion next-enterprise/src/sanity/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
8 changes: 4 additions & 4 deletions next-enterprise/src/sanity/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export async function sanityFetch<const QueryString extends string>({
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()}
}

0 comments on commit 5eb1e1b

Please sign in to comment.