(authorId: string)
| 8 | import { buildPostRo } from './postHelpers'; |
| 9 | |
| 10 | export async function listPosts(authorId: string) { |
| 11 | const posts = await db.post.findMany({ where: { authorId }, |
| 12 | orderBy: { createdAt: 'desc' }, |
| 13 | }); |
| 14 | return posts.map((post) => buildPostRo(post)); |
| 15 | } |
| 16 | |
| 17 | export async function createNewPost(authorId: string, payload: PostCreateDto) { |
| 18 | const alreadyExists = !!await db.post.findUnique({ |
nothing calls this directly
no test coverage detected