-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/paxi user #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/paxi user #103
Conversation
2f6fb7d to
21a076c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a Paxi service administration feature for user management, allowing admins to view and modify user information, carpool participation history, and settlement status.
- Adds Paxi API integration with axios instance configuration
- Creates comprehensive user detail page with Paxi-specific information including nickname editing
- Implements carpool room management table with edit capabilities and kick reason display
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| utils/axios.instance.js | Adds PaxiAxios instance for Paxi service API integration |
| pages/user/[uuid].jsx | Enhances user detail page with Paxi user info, nickname editing, and carpool participation tab |
| components/paxi/paxi.room.table.jsx | Creates new component for displaying and managing carpool room data with edit modals |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| setIsLoading(false); | ||
| }) | ||
| .catch((err) => { | ||
| console.log('API 요청 중 오류 발생:', err); |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting isLoading to false in the catch block may hide loading states when some API calls succeed but others fail, leading to inconsistent UI state.
| console.log('API 요청 중 오류 발생:', err); | |
| // setIsLoading(false) will be called in finally | |
| }) | |
| .catch((err) => { | |
| console.log('API 요청 중 오류 발생:', err); | |
| // setIsLoading(false) will be called in finally | |
| }) | |
| .finally(() => { |
| setEditForm({}); | ||
|
|
||
| // 페이지 새로고침으로 업데이트된 데이터 반영 | ||
| window.location.reload(); |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using window.location.reload() forces a full page refresh instead of updating the component state. Consider updating the local state or refetching only the necessary data.
| window.location.reload(); | |
| // 변경된 데이터 반영을 위해 방 목록을 다시 불러옵니다. | |
| if (typeof fetchRooms === 'function') { | |
| await fetchRooms(); | |
| } |
| const isPaid = await fetchPaymentStatus(room.uuid, userUuid); | ||
| statuses[room.uuid] = isPaid; | ||
| } | ||
|
|
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sequential API calls in a for loop will be slow for many rooms. Consider using Promise.all() to make concurrent requests.
| const promises = rooms.map(room => | |
| fetchPaymentStatus(room.uuid, userUuid).then(isPaid => [room.uuid, isPaid]) | |
| ); | |
| const results = await Promise.all(promises); | |
| const statuses = Object.fromEntries(results); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
비동기로 돌리면 한 대로 돌아가는 서버, DB 부하 올라갈 수 있어서 걍 그대로 둠
components/paxi/paxi.room.table.jsx
Outdated
| onChange={(e) => | ||
| setEditForm({ | ||
| ...editForm, | ||
| maxParticipant: parseInt(e.target.value), |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseInt() without a radix parameter can lead to unexpected behavior. Use parseInt(e.target.value, 10) to explicitly specify base 10.
| maxParticipant: parseInt(e.target.value), | |
| maxParticipant: parseInt(e.target.value, 10), |
Paxi 서비스를 관리하기 위한 유저 정보 조회 및 수정 어드민페이지 개발
구현한 것들
관련 이슈: #99
TODO: 백엔드에서 관리자 행동 로깅 찍어야 할 듯. 특히 방 정보 수정에서
기본 화면 구성
추방된 상태 클릭 시 추방 사유 나옴
탭 아무 곳이나 클릭 시 정보 수정 모달
정보 수정 요청 시 확인 받음