Skip to content

Commit

Permalink
feat: 게시글 조회 및 좋아요 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bae-sh committed Jan 3, 2024
1 parent e1d70f0 commit 2144e42
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/components/board/PostDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function PostDetail({ data, IS_AUTHOR }: PostDetail) {

<p className="text-gray-400">{parseDate(data?.postCreatedAt)}</p>
<hr />
<p className="text-sm text-gray-400">좋아요 0 | 조회 0</p>
<p className="text-sm text-gray-400">{`좋아요 ${data.likes} | 조회 ${data.hits}`}</p>
</article>
);
}
2 changes: 1 addition & 1 deletion client/src/components/common/Post/PostSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function PostSummary({
/>
<div className="flex justify-between">
<div className="flex flex-col gap-1">
<p className="text-sm text-gray-400">좋아요 0 | 조회 0</p>
<p className="text-sm text-gray-400">{`좋아요 ${postInfoData.likes} | 조회 ${postInfoData.hits}`}</p>
<p className="text-gray-400">
{parseDate(postInfoData?.postCreatedAt)}
</p>
Expand Down
2 changes: 2 additions & 0 deletions client/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface IPostInformation {
postTitle: string;
postType: string;
postUpdatedAt: string;
hits: number;
likes: number;
}

export interface IBoardPostInformation
Expand Down

0 comments on commit 2144e42

Please sign in to comment.