svrjs-nextjs-website/lib/getBlogPost.ts

9 lines
231 B
TypeScript
Raw Normal View History

2024-08-24 06:28:25 +02:00
import { client } from "./sanity";
export const getAllBlogPostSlugs = async () => {
const query = `*[_type == 'blog'] { "slug": slug.current }`;
const slugs: { slug: string }[] = await client.fetch(query);
2024-08-24 06:28:25 +02:00
return slugs;
2024-08-24 06:28:25 +02:00
};