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

Function createPostHandler

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

Source from the content-addressed store, hash-verified

8} from "../service/post.service";
9
10export async function createPostHandler(req: Request, res: Response) {
11 const userId = get(req, "user._id");
12 const body = req.body;
13
14 const post = await createPost({ ...body, user: userId });
15
16 return res.send(post);
17}
18
19export async function updatePostHandler(req: Request, res: Response) {
20 const userId = get(req, "user._id");

Callers

nothing calls this directly

Calls 1

createPostFunction · 0.90

Tested by

no test coverage detected