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
Some checks failed
Deploy Next.js application / deploy (push) Has been cancelled
This commit is contained in:
parent
4e39de386a
commit
e3ec044db8
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue