@@ -17,26 +17,25 @@ router.post("/", async (req, res) => {
17
17
}
18
18
} ) ;
19
19
20
- // * Front-End Route for one post's details
21
- router . get ( "/:id" , async ( req , res ) => {
22
- console . info ( `${ req . method } request received for post details` ) ;
23
- try {
24
- const thisPost = await Post . findAll ( {
25
- attributes : [ "id" , "title" , "text" , "createdAt" ] ,
26
- } ) ;
27
-
28
- const post = thisPost . map ( ( post ) => post . get ( { plain : true } ) ) ;
29
-
30
- res . render ( "post-details" , {
31
- post,
32
- logged_in : req . session . logged_in ,
33
- email : req . session . email ,
34
- username : req . session . username ,
35
- title : "Home" ,
36
- } ) ;
37
- } catch ( err ) {
38
- res . status ( 500 ) . json ( err ) ;
39
- }
40
- } ) ;
20
+ // router.get("/:id", withAuth, async (req, res) => {
21
+ // console.info(`${req.method} request received for post details`);
22
+ // try {
23
+ // const thisPost = await Post.findAll({
24
+ // attributes: ["id", "title", "text", "createdAt"],
25
+ // });
26
+ //
27
+ // const post = thisPost.map((post) => post.get({ plain: true }));
28
+ //
29
+ // res.render("post-details", {
30
+ // post,
31
+ // logged_in: req.session.logged_in,
32
+ // email: req.session.email,
33
+ // username: req.session.username,
34
+ // title: "Home",
35
+ // });
36
+ // } catch (err) {
37
+ // res.status(500).json(err);
38
+ // }
39
+ // });
41
40
42
41
module . exports = router ;
0 commit comments