refactor: 정산 뷰 수정#62
Conversation
…or/56-settlement-integration # Conflicts: # Frontend/luckeyseven/src/pages/Settlement/SettlementEditPage.jsx # Frontend/luckeyseven/src/pages/Settlement/SettlementNewPage.jsx # Frontend/luckeyseven/src/pages/Settlement/TeamSettlementsPage.jsx
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the settlement view by updating API calls, standardizing team ID usage with Recoil and route params, and adjusting UI components to use nickname-based user data.
- Updates API update methods from PUT to PATCH for consistency.
- Incorporates teamId from Recoil and URL parameters in settlement pages.
- Refactors component renderings such as UserProfile and settlement links, and renames toggling methods in the backend.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Frontend/luckeyseven/src/service/settlementService.js | Updated updateSettlement to use PATCH and include an empty data object for settledOnly operations. |
| Frontend/luckeyseven/src/pages/Settlement/TeamSettlementsPage.jsx | Adjusted teamId logic to combine Recoil and URL params; updated data fetching using API response meta. |
| Frontend/luckeyseven/src/pages/Settlement/SettlementNewPage.jsx | Updated teamId assignment using Recoil and useParams. |
| Frontend/luckeyseven/src/pages/Settlement/SettlementEditPage.jsx | Standardized teamId usage via Recoil and URL params. |
| Frontend/luckeyseven/src/pages/Settlement/SettlementDetailPage.jsx | Modified routing for edit navigation and added debug log (console.info). |
| Frontend/luckeyseven/src/components/settlement/settlement-list.jsx | Updated settlement display to use nickname fields and reformatted link component; review link path consistency. |
| Frontend/luckeyseven/src/components/settlement/settlement-form.jsx | Adjusted initial form data assignment and updated field rendering to use nickname/description values. |
| Frontend/luckeyseven/src/components/settlement/settlement-filter.jsx | Removed unused teamId prop and updated option labels with nickname/description. |
| Frontend/luckeyseven/src/components/settlement/settlement-detail.jsx | Updated displayed expense descriptions and applied teamId in edit navigation. |
| Frontend/luckeyseven/src/components/common/UserProfile.jsx | Changed component to use nickname instead of full user object for display. |
| Frontend/luckeyseven/src/components/common/SettlementActions.jsx | Updated API call parameters and formatting; preserved toggle behavior for settlement status. |
| Frontend/luckeyseven/src/App.jsx | Adjusted settlement route paths to include teamId for new and edit pages. |
| Backend/* | Renamed methods and updated toggling of settlement status, with corresponding test updates and mapper adjustments. |
Comments suppressed due to low confidence (3)
Frontend/luckeyseven/src/service/settlementService.js:49
- Ensure the backend supports using PATCH for both partial and full updates after replacing PUT. Update API documentation if necessary.
const response = await privateApi.patch(`/api/settlements/${id}`, {}, {params: {settledOnly: true}});
Frontend/luckeyseven/src/pages/Settlement/SettlementDetailPage.jsx:21
- [nitpick] Consider removing or reducing debug logging before production deployment.
console.info("팀아이디", settlement.teamId)
Backend/src/main/java/com/luckyseven/backend/domain/settlements/entity/Settlement.java:83
- Toggling the settled status with 'convertSettled' might lead to unintended behavior if the current state is not as expected. Consider using explicit methods to set the status to true or false.
public void convertSettled() { this.isSettled = !this.isSettled; }
| </div> | ||
| <div className="space-y-4"> | ||
| {settlements.map((settlement) => ( | ||
| <Link to={`/settlements/${settlement.id}`} key={settlement.id} |
There was a problem hiding this comment.
The route path for settlement details may need to include the teamId parameter for consistency with the updated routes. Verify and update the Link path if required.
| ) : ( | ||
| <div | ||
| className="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center"> | ||
| {nickname.charAt(0) || "?"} |
There was a problem hiding this comment.
Ensure 'nickname' is defined before calling charAt(0) in the fallback rendering to avoid potential runtime errors. Use a conditional check or default value.
| {nickname.charAt(0) || "?"} | |
| {nickname && typeof nickname === "string" ? nickname.charAt(0) : "?"} |
#️⃣연관된 이슈 번호
#56
📝작업 내용
🧪 테스트 여부
💬리뷰 요구사항