MCPcopy Index your code
hub / github.com/TomDoesTech/REST-API-Tutorial / getPostHandler

Function getPostHandler

src/controller/post.controller.ts:38–47  ·  view source on GitHub ↗
(req: Request, res: Response)

Source from the content-addressed store, hash-verified

36 return res.send(updatedPost);
37}
38export async function getPostHandler(req: Request, res: Response) {
39 const postId = get(req, "params.postId");
40 const post = await findPost({ postId });
41
42 if (!post) {
43 return res.sendStatus(404);
44 }
45
46 return res.send(post);
47}
48
49export async function deletePostHandler(req: Request, res: Response) {
50 const userId = get(req, "user._id");

Callers

nothing calls this directly

Calls 1

findPostFunction · 0.90

Tested by

no test coverage detected