Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpandeey committed Aug 6, 2024
1 parent 33a656e commit 2abc83b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const connectDatabase = async (DB_URL) => {
mongoose
.connect(DB_URL)
.then((data) => {
console.log(`Mongodb connected with server ${data.connection.host}`);
console.log(`Mongodb connected with server ${data.connection.host}`);
})
.catch((err) => {
console.log(err, "error");
Expand Down
2 changes: 1 addition & 1 deletion controllers/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const createBlog = async (req, res) => {

export const getAllBlogs = async (req, res) => {
try {
const result = await BlogModel.find({});
const result = await BlogModel.find({}).populate("createdBy");
const blogCount = await BlogModel.countDocuments({});

//here only we will check
Expand Down

0 comments on commit 2abc83b

Please sign in to comment.