Skip to content

Commit

Permalink
[FIX] 커뮤니티 게시물 카테고리별 조회 response에 게시물 작성자 본인여부 bool 타입 추가 (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
yubinquitous authored Jun 25, 2024
1 parent fa6e6fd commit 62299a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/db/community.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ const getCommunityCategoryPostsById = async (
) => {
const { rows } = await client.query(
`
SELECT cp.id, u.nickname, cp.title, cp.body, cp.content_url, cp.content_title, cp.content_description, cp.thumbnail_url, cp.created_at
SELECT cp.id, u.nickname, cp.title, cp.body, cp.content_url, cp.content_title, cp.content_description, cp.thumbnail_url, cp.created_at,
CASE WHEN cp.user_id = $1 THEN TRUE ELSE FALSE END as is_author
FROM community_post cp
JOIN "user" u ON cp.user_id = u.id
JOIN community_category_post ccp ON cp.id = ccp.community_post_id
Expand Down

0 comments on commit 62299a4

Please sign in to comment.