Skip to content

Commit 50fb741

Browse files
committed
fix editor api
1 parent 04ee9e0 commit 50fb741

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/v1/blog/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ router.get('/id/:id', validator(schema.blogId, ValidationSource.PARAM),
8181
asyncHandler(async (req: ProtectedRequest, res, next) => {
8282
const blog = await BlogRepo.findBlogAllDataById(new Types.ObjectId(req.params.id));
8383

84-
if (blog == null) throw new BadRequestError('Blog does not exists');
84+
if (!blog) throw new BadRequestError('Blog does not exists');
8585
if (!blog.isSubmitted && !blog.isPublished) throw new ForbiddenError('This blog is private');
8686

8787
new SuccessResponse('success', blog).send(res);

0 commit comments

Comments
 (0)