Skip to content

Conversation

@khkim6040
Copy link
Member

@khkim6040 khkim6040 commented Aug 7, 2025

Paxi 서비스를 관리하기 위한 유저 정보 조회 및 수정 어드민페이지 개발

구현한 것들

  • 유저별 카풀 참여 이력 확인, 정산 상태 확인
    • 강퇴사유 확인
  • 방 정보 확인, 변경
  • 부적절한 닉네임 변경

관련 이슈: #99

TODO: 백엔드에서 관리자 행동 로깅 찍어야 할 듯. 특히 방 정보 수정에서

기본 화면 구성

image

추방된 상태 클릭 시 추방 사유 나옴

image

탭 아무 곳이나 클릭 시 정보 수정 모달

image

정보 수정 요청 시 확인 받음

image

@khkim6040 khkim6040 marked this pull request as draft August 7, 2025 15:04
@khkim6040 khkim6040 self-assigned this Aug 13, 2025
@khkim6040 khkim6040 added the paxi Paxi 관련 작업 label Aug 13, 2025
@khkim6040 khkim6040 requested a review from Copilot August 13, 2025 03:35

This comment was marked as outdated.

@khkim6040 khkim6040 marked this pull request as ready for review August 13, 2025 05:12
@khkim6040 khkim6040 requested a review from Copilot August 13, 2025 05:14
Copy link
Contributor

Copilot AI left a 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);
Copy link

Copilot AI Aug 13, 2025

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.

Suggested change
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(() => {

Copilot uses AI. Check for mistakes.
setEditForm({});

// 페이지 새로고침으로 업데이트된 데이터 반영
window.location.reload();
Copy link

Copilot AI Aug 13, 2025

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.

Suggested change
window.location.reload();
// 변경된 데이터 반영을 위해 방 목록을 다시 불러옵니다.
if (typeof fetchRooms === 'function') {
await fetchRooms();
}

Copilot uses AI. Check for mistakes.
const isPaid = await fetchPaymentStatus(room.uuid, userUuid);
statuses[room.uuid] = isPaid;
}

Copy link

Copilot AI Aug 13, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비동기로 돌리면 한 대로 돌아가는 서버, DB 부하 올라갈 수 있어서 걍 그대로 둠

onChange={(e) =>
setEditForm({
...editForm,
maxParticipant: parseInt(e.target.value),
Copy link

Copilot AI Aug 13, 2025

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.

Suggested change
maxParticipant: parseInt(e.target.value),
maxParticipant: parseInt(e.target.value, 10),

Copilot uses AI. Check for mistakes.
@khkim6040 khkim6040 merged commit 9d9b6e6 into main Aug 13, 2025
2 checks passed
@khkim6040 khkim6040 deleted the feat/paxi-user branch August 13, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

paxi Paxi 관련 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants