Skip to content

Commit

Permalink
Showing who the post was created by in view-post view
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Martinez committed Jul 28, 2023
1 parent 983eaf6 commit 6cfeeb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions controllers/api/post-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ router.get('/:id', async (req, res) => {

const allComments = post.comments.map((data) => data.dataValues)

console.log('COMMENTS: ', allComments)

if (req.session.logged_in) {
res.render('view-post', {
post,
Expand Down
5 changes: 3 additions & 2 deletions views/view-post.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
class='mt-4 text-lg leading-8 text-gray-600'
>{{post.dataValues.post_text}}</p>
<p class='mt-4 text-md leading-8 text-gray-600'>Posted on
{{post.dataValues.created_on}}</p>

{{post.dataValues.created_on}}
by
{{post.user.dataValues.full_name}}</p>
</div>
{{#if allComments.length}}
<div
Expand Down

0 comments on commit 6cfeeb1

Please sign in to comment.