fix: disable cache for Sanity GROQ query for getting all the blog post slugs
Some checks failed
Deploy Next.js application / deploy (push) Has been cancelled

This commit is contained in:
Dorian Niemiec 2024-09-13 16:14:41 +02:00
parent 4e39de386a
commit e3ec044db8

View file

@ -2,7 +2,11 @@ import { client } from "./sanity";
export const getAllBlogPostSlugs = async () => {
const query = `*[_type == 'blog'] { "slug": slug.current }`;
const slugs: { slug: string }[] = await client.fetch(query);
const slugs: { slug: string }[] = await client.fetch(
query,
{},
{ cache: "no-store" }
);
return slugs;
};