MCPcopy Create free account
hub / github.com/LeChatErrant/API-template / listPosts

Function listPosts

src/routes/post/postControllers.ts:10–15  ·  view source on GitHub ↗
(authorId: string)

Source from the content-addressed store, hash-verified

8import { buildPostRo } from './postHelpers';
9
10export 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
17export async function createNewPost(authorId: string, payload: PostCreateDto) {
18 const alreadyExists = !!await db.post.findUnique({

Callers

nothing calls this directly

Calls 1

buildPostRoFunction · 0.90

Tested by

no test coverage detected