This commit is contained in:
yashrajverma 2021-05-19 15:53:34 +05:30
parent 5567767d97
commit c003038778
1 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,10 @@ const User = require("../models/User");
module.exports.getAllBlogs = async (req, res, next) => {
try {
let blog = await Blog.find();
let blog = await Blog.find().populate(
"author",
"-passwordResetToken -password"
);
if (blog) {
res.json({ blogs: blog });
} else {