Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Update postRouter to include postValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
nmcc1212 committed Feb 16, 2024
1 parent 3e3a462 commit 55b43e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion newAPI/src/routes/postRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down

0 comments on commit 55b43e1

Please sign in to comment.