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: '/post',
  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