Merge pull request #13 from yashrajverma/yashrajverma

Done!
This commit is contained in:
yashraj verma 2021-05-19 15:54:43 +05:30 committed by GitHub
commit 4248f4d95f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) => { module.exports.getAllBlogs = async (req, res, next) => {
try { try {
let blog = await Blog.find(); let blog = await Blog.find().populate(
"author",
"-passwordResetToken -password"
);
if (blog) { if (blog) {
res.json({ blogs: blog }); res.json({ blogs: blog });
} else { } else {