Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @g-hyxn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 관리자 신고 페이지에서 신고된 게시물로 이동할 때 사용되는 링크의 경로가 올바르지 않던 문제를 해결합니다. 변경된 경로는 사용자가 정확한 게시물 페이지로 이동할 수 있도록 보장합니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| onClick={() => | ||
| navigate(`/post-content/${report.reportedPostId}`) | ||
| } | ||
| onClick={() => navigate(`/post/${report.reportedPostId}`)} |
There was a problem hiding this comment.
하드코딩된 경로 문자열은 오타에 취약하고 나중에 경로 구조가 변경될 때 여러 곳을 수정해야 하는 불편함이 있습니다.
유지보수성을 높이기 위해 경로들을 상수로 관리하는 것을 고려해보세요. 예를 들어, src/constants/paths.ts와 같은 파일을 만들어 경로를 중앙에서 관리할 수 있습니다.
// src/constants/paths.ts
export const PATHS = {
POST_DETAIL: (postId: number | string) => `/post/${postId}`,
// ... other paths
};그리고 다음과 같이 사용할 수 있습니다.
// AdminReport.tsx
import { PATHS } from '@/constants/paths';
// ...
onClick={() => navigate(PATHS.POST_DETAIL(report.reportedPostId))}이렇게 하면 경로가 변경되어도 paths.ts 파일만 수정하면 되므로 관리가 용이해지고, 자동 완성을 통해 오타를 줄일 수 있습니다.
💡 배경 및 개요
Resolves: #{이슈번호}
📃 작업내용
🙋♂️ 리뷰노트
✅ PR 체크리스트
.env,노션,README)"API 개발 완료됐어요","환경값 추가되었어요")🎸 기타