reports 페이지 api 필드명 불일치 버그 수정 및 레이아웃 조정#271
Conversation
워크스루AdminLayout에서 children을 변경 사항
예상 코드 리뷰 노력🎯 2 (Simple) | ⏱️ ~10 minutes 제안된 레이블
제안된 검토자
시
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@service/app/src/entities/report/hooks/useAdminReports.ts`:
- Around line 36-37: In useAdminReports the expression data?.content.map(...)
can throw if data exists but content is undefined; change the construction that
builds games so it safely handles missing content by mapping over a guaranteed
array (e.g., use (data?.content ?? []) before calling map) when producing
ReportedGame[] for games and keep using mapAdminReportToReportedGame to
transform each report.
🧹 Nitpick comments (1)
service/app/src/app/admin/layout.tsx (1)
39-39:h-screen과pt-[90px]조합으로 인한 레이아웃 오버플로우 가능성
h-screen(100vh)에pt-[90px]을 적용하면 실제 컨텐츠 영역이 뷰포트를 초과하여 불필요한 스크롤이 발생할 수 있습니다.💡 대안 제안
- <main className="h-screen pt-[90px]">{children}</main> + <main className="h-[calc(100vh-90px)] mt-[90px]">{children}</main>또는 부모에
h-screen과flex flex-col을 적용하고,<main>에flex-1 overflow-hidden을 사용하는 방식도 고려해 보세요.
| const games: ReportedGame[] = | ||
| data?.report.map((report) => mapAdminReportToReportedGame(report)) ?? [] | ||
| data?.content.map((report) => mapAdminReportToReportedGame(report)) ?? [] |
There was a problem hiding this comment.
content가 undefined일 경우 런타임 에러 발생 가능
data?.content.map(...)에서 data가 존재하지만 content가 undefined인 경우 TypeError: Cannot read properties of undefined가 발생할 수 있습니다.
🛡️ 방어적 코딩 제안
const games: ReportedGame[] =
- data?.content.map((report) => mapAdminReportToReportedGame(report)) ?? []
+ data?.content?.map((report) => mapAdminReportToReportedGame(report)) ?? []📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const games: ReportedGame[] = | |
| data?.report.map((report) => mapAdminReportToReportedGame(report)) ?? [] | |
| data?.content.map((report) => mapAdminReportToReportedGame(report)) ?? [] | |
| const games: ReportedGame[] = | |
| data?.content?.map((report) => mapAdminReportToReportedGame(report)) ?? [] |
🤖 Prompt for AI Agents
In `@service/app/src/entities/report/hooks/useAdminReports.ts` around lines 36 -
37, In useAdminReports the expression data?.content.map(...) can throw if data
exists but content is undefined; change the construction that builds games so it
safely handles missing content by mapping over a guaranteed array (e.g., use
(data?.content ?? []) before calling map) when producing ReportedGame[] for
games and keep using mapAdminReportToReportedGame to transform each report.
|
Deploy preview for re-creation ready! ✅ Preview Built with commit 1e27dfb. |
📝 설명
🛠️ 주요 변경 사항
리뷰 시 고려해야 할 사항
Summary by CodeRabbit
릴리스 노트
스타일
리팩토링
✏️ Tip: You can customize this high-level summary in your review settings.