From 19da5c5568d409535be4aaa28bbffef00a8f89c8 Mon Sep 17 00:00:00 2001 From: Christian Martinez Date: Tue, 25 Jul 2023 14:45:19 -0600 Subject: [PATCH] The blogs that are mapped on the home page are looking nice. Thanks tailwind! --- controllers/home-routes.js | 4 ++-- models/Post.js | 2 +- views/home.handlebars | 39 ++++++++++++++++++-------------------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/controllers/home-routes.js b/controllers/home-routes.js index 38acf69..7f3b2f6 100644 --- a/controllers/home-routes.js +++ b/controllers/home-routes.js @@ -4,8 +4,8 @@ const { Post, User, Comment } = require('../models') router.get('/', (req, res) => { console.log(req.session) Post.findAll({ - attributes: ['id', 'post_text', 'title', 'created_at'], - order: [['created_at', 'DESC']], + attributes: ['id', 'post_text', 'title', 'created_on'], + order: [['created_on', 'DESC']], include: [ { model: User, diff --git a/models/Post.js b/models/Post.js index 48a69f8..dfbe104 100644 --- a/models/Post.js +++ b/models/Post.js @@ -21,7 +21,7 @@ Post.init( len: [1], }, }, - created_at: { + created_on: { type: DataTypes.DATEONLY, allowNull: false, defaultValue: DataTypes.NOW, diff --git a/views/home.handlebars b/views/home.handlebars index 4f72a0a..015e6d0 100644 --- a/views/home.handlebars +++ b/views/home.handlebars @@ -1,47 +1,44 @@ -
+

Latest blogs

-

Browse through recent +

Browse through recent blogs created by people from around the world