Skip to content
Merged
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 src/pages/post/MyPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function MyPost() {
likeCount={0}
commentCount={0}
timeAgo={new Date(post.createdAt).toLocaleDateString()}
onPostClick={() => navigate(`/post-content/${post.id}`)}
onPostClick={() => navigate(`/post/${post.id}`)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

라우트 κ²½λ‘œκ°€ λ¬Έμžμ—΄λ‘œ ν•˜λ“œμ½”λ”©λ˜μ–΄ μžˆμ–΄ μœ μ§€λ³΄μˆ˜κ°€ μ–΄λ ΅μŠ΅λ‹ˆλ‹€. μ΄λŠ” μ˜€νƒ€ λ°œμƒ κ°€λŠ₯성을 높이고, λ‚˜μ€‘μ— κ²½λ‘œκ°€ 변경될 λ•Œ μ—¬λŸ¬ νŒŒμΌμ„ μˆ˜μ •ν•΄μ•Ό ν•˜λŠ” λ²ˆκ±°λ‘œμ›€μ„ μ•ΌκΈ°ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

μ€‘μ•™μ—μ„œ 경둜λ₯Ό κ΄€λ¦¬ν•˜λŠ” νŒŒμΌμ„ λ§Œλ“€μ–΄ (예: src/constants/routes.ts) μ‚¬μš©ν•˜λŠ” 것을 ꢌμž₯ν•©λ‹ˆλ‹€. μ΄λ ‡κ²Œ ν•˜λ©΄ μ½”λ“œμ˜ 일관성을 μœ μ§€ν•˜κ³  μ‹€μˆ˜λ₯Ό 쀄일 수 μžˆμŠ΅λ‹ˆλ‹€.

μ˜ˆμ‹œ (src/constants/routes.ts):

export const ROUTES = {
  POST_DETAIL: (postId: number | string) => `/post/${postId}`,
  // ... other routes
};

적용 ν›„:

import { ROUTES } from '@/constants/routes';
// ...
onPostClick={() => navigate(ROUTES.POST_DETAIL(post.id))}

actions={[
{
icon: <Delete />,
Expand Down
Loading