Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/blogControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const deleteBlog = async (req: Request, res: Response, next: NextFunction) => {
const updateBlog = async (req: Request, res: Response, next: NextFunction) => {
try {;
const blogId = new Types.ObjectId(req.params.id);
const blog = await BlogModel.BlogSchema.findByIdAndUpdate(blogId, req.body)
const blog = await BlogModel.BlogSchema.findByIdAndUpdate(blogId, req.body,{new: true})
return res.status(httpStatus.OK).json({
blog: blog,
message: "Blog was updated successfully"
Expand Down