From 55b43e14532ea681f9c0f9fcda95669e3e573742 Mon Sep 17 00:00:00 2001 From: Nial <48334675+nmcc1212@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:34:07 +0000 Subject: [PATCH] Update postRouter to include postValidation --- newAPI/src/routes/postRoutes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newAPI/src/routes/postRoutes.ts b/newAPI/src/routes/postRoutes.ts index 6966661..fd0487c 100644 --- a/newAPI/src/routes/postRoutes.ts +++ b/newAPI/src/routes/postRoutes.ts @@ -123,7 +123,7 @@ const postValidation = [ body("content").notEmpty().withMessage("Content is required"), ]; // content required in body, returns created post -postRouter.post("/", authenticateUser, async (req: Request, res: Response) => { +postRouter.post("/", authenticateUser, postValidation, async (req: Request, res: Response) => { if (!req.body.content) { return res.status(400).json({ message: "Content is required" }); }