Skip to content

Commit

Permalink
bug : 상세 페이지 DB에 없는 게시글 조회시 에러 페이지로 - close #388
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeseokWoo committed Dec 5, 2021
1 parent 993cc3e commit c5f67a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/controller/post-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const getPosts = async (req: Request, res: Response, next: Function) => {
export const getPost = async (req: Request, res: Response, next: Function) => {
try {
const post = await postService.getPost(req.params.postId);
if (!post) return next(ERROR.DB_READ_FAIL);
const userId = req.session.userId;
let isParticipate: boolean;
if (userId === undefined) isParticipate = false;
Expand Down

0 comments on commit c5f67a8

Please sign in to comment.