svrjs-nextjs-website/lib/getBlogPost.ts
Cypro Freelance 1435cbb397 some stuffs
2024-08-24 09:58:25 +05:30

8 lines
228 B
TypeScript

import { client } from "./sanity";
export const getAllBlogPostSlugs = async () => {
const query = `*[_type == 'blog'] { "slug": slug.current }`;
const slugs: { slug: string }[] = await client.fetch(query);
return slugs;
};