[FE] 관리자 페이지 피드백 확인하기 페이지#353
Hidden character warning
Conversation
개요관리자가 사용자 피드백을 확인할 수 있는 새로운 페이지와 기능을 추가했습니다. 변경사항
예상 코드 리뷰 난이도🎯 3 (중간) | ⏱️ ~20분 관련 이슈
관련 PR
제안된 리뷰어
체리 토끼의 축하시
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Pull request overview
관리자 영역에서 사용자 피드백 목록을 조회할 수 있는 신규 페이지를 추가하여, 운영자가 접수된 피드백을 페이지네이션/새로고침으로 확인할 수 있게 합니다.
Changes:
- 관리자 피드백 목록 조회 API 유틸(
getAdminFeedbacks) 추가 /admin/feedbacks라우팅 및 사이드바 메뉴 항목 추가- 관리자 피드백 목록 UI(페이지/리스트 컴포넌트 및 CSS) 신규 구현
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/utils/adminFeedbackApi.js | 관리자 피드백 페이지네이션 조회 API 래퍼 추가 |
| frontend/src/pages/AdminFeedback.module.css | 관리자 피드백 페이지 레이아웃 스타일 추가 |
| frontend/src/pages/AdminFeedback.jsx | 관리자 피드백 페이지(헤더/사이드바/리스트) 구성 추가 |
| frontend/src/components/AdminHome/AdminSidebar.jsx | 관리자 사이드바에 “피드백 확인하기” 메뉴 추가 |
| frontend/src/components/AdminFeedback/AdminFeedbackList.module.css | 피드백 리스트/페이지네이션/로딩 상태 UI 스타일 추가 |
| frontend/src/components/AdminFeedback/AdminFeedbackList.jsx | 피드백 목록 조회, 상태 처리(로딩/에러), 페이지네이션 UI 구현 |
| frontend/src/App.jsx | /admin/feedbacks 라우트 등록 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
frontend/src/utils/adminFeedbackApi.js (1)
3-13: 페이지/사이즈 파라미터를 방어적으로 보정해두면 더 안전합니다.Line 11~12는
toInt결과를 그대로 사용해서page < 0또는size <= 0값이 그대로 전송될 수 있습니다. 유틸 레벨에서 한 번 보정해두면 호출처가 늘어나도 안전합니다.제안 diff
export const getAdminFeedbacks = async ({ page = 0, size = 10 } = {}) => { + const safePage = Math.max(0, toInt(page, 0)); + const safeSize = Math.max(1, toInt(size, 10)); const response = await api.get('/api/admin/feedbacks', { params: { - page: toInt(page, 0), - size: toInt(size, 10), + page: safePage, + size: safeSize, sort: 'createdDate,desc', }, });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/utils/adminFeedbackApi.js` around lines 3 - 13, getAdminFeedbacks currently passes the raw toInt results for page and size which allows negative or zero sizes to be sent; clamp and sanitize the values inside getAdminFeedbacks (use toInt(page,0) and toInt(size,10) then enforce page = Math.max(0, page) and size = Math.max(1, size) and optionally cap size to a sensible max) so the params sent by getAdminFeedbacks are always non-negative page and positive size; update the params object in getAdminFeedbacks to use these sanitized variables and keep using the helper toInt for parsing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/src/components/AdminFeedback/AdminFeedbackList.jsx`:
- Around line 43-46: In the catch block that currently calls setFeedbacks([])
and setError(...), also reset the component's pagination/metadata state so the
UI labels don't show stale values — e.g. call the relevant setters such as
setPage(1) and setTotalCount(0) (or reset any state variables like totalCount,
currentPage, pageSize) alongside setFeedbacks and setError so the top count/page
labels reflect the empty/error state; update the catch block in
AdminFeedbackList.jsx where setFeedbacks and setError are called.
- Around line 31-53: The fetchFeedbacks useCallback currently lists page in its
dependency array causing a new function reference whenever page changes and
triggering the useEffect that calls fetchFeedbacks(0), which resets pagination;
fix this by removing page from the dependency array of useCallback for
fetchFeedbacks and change its parameter default from (nextPage = page) to
(nextPage = 0) so it no longer closes over page, keeping the rest of the logic
(calls to getAdminFeedbacks, PAGE_SIZE, setFeedbacks, setPage, setTotalPages,
setTotalElements, setError, setIsLoading) unchanged and leaving the useEffect(()
=> { fetchFeedbacks(0) }, [fetchFeedbacks]) as-is.
---
Nitpick comments:
In `@frontend/src/utils/adminFeedbackApi.js`:
- Around line 3-13: getAdminFeedbacks currently passes the raw toInt results for
page and size which allows negative or zero sizes to be sent; clamp and sanitize
the values inside getAdminFeedbacks (use toInt(page,0) and toInt(size,10) then
enforce page = Math.max(0, page) and size = Math.max(1, size) and optionally cap
size to a sensible max) so the params sent by getAdminFeedbacks are always
non-negative page and positive size; update the params object in
getAdminFeedbacks to use these sanitized variables and keep using the helper
toInt for parsing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 15a04de7-c790-4e55-948d-b5c743fb260c
📒 Files selected for processing (7)
frontend/src/App.jsxfrontend/src/components/AdminFeedback/AdminFeedbackList.jsxfrontend/src/components/AdminFeedback/AdminFeedbackList.module.cssfrontend/src/components/AdminHome/AdminSidebar.jsxfrontend/src/pages/AdminFeedback.jsxfrontend/src/pages/AdminFeedback.module.cssfrontend/src/utils/adminFeedbackApi.js
관리자 페이지에 피드백 확인하기 페이지 추가
Summary by CodeRabbit