9 lines
308 B
TypeScript
9 lines
308 B
TypeScript
import { cache, reader } from '@/lib/readers/base';
|
|
|
|
export const getAuthors = cache(async () => reader.collections.authors.all());
|
|
|
|
export const getAuthorBySlug = cache(async (slug: string) => {
|
|
const author = await reader.collections.authors.read(slug);
|
|
return author ? { ...author, slug } : null;
|
|
});
|