[FE] SISC1-222 [FIX] : 사용자가 취소한 베팅 필터링#149
Conversation
Walkthrough두 파일에서 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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: 0
🧹 Nitpick comments (2)
frontend/src/utils/bettingHistory.js (1)
7-8:DELETED필터링 방향은 적절하고, 변수명·방어 로직만 소소하게 정리 제안
betStatus !== 'DELETED'로 한 번에 필터링하는 구조는 요구사항에 잘 맞고,getDailyBetHistory/getWeeklyBetHistory모두에 일관되게 적용돼서 좋습니다.- 다만 변수명이
filterdRes로 오타가 있어 가독성을 위해filteredRes로 변경하는 편이 좋겠습니다.- 추가로, 방어적인 측면에서
res.data가 배열이 아닐 때를 대비해 한 번 감싸두는 것도 고려해볼 수 있습니다.- const filterdRes = res.data.filter((r) => r.betStatus !== 'DELETED'); - return filterdRes; + const data = Array.isArray(res.data) ? res.data : []; + const filteredRes = data.filter((r) => r.betStatus !== 'DELETED'); + return filteredRes;frontend/src/components/stockgame/Betting.jsx (1)
41-44: 삭제된 베팅을 상태 계산에서 제외하는 로직은 적절하며, 약간의 중복만 확인 필요
data.betRoundId === userBets.betRoundId && userBets.betStatus !== 'DELETED'조건으로, 삭제된 베팅을 베팅 상태에서 확실히 제외하는 방향은 요구사항에 잘 맞습니다.- 다만
userBets는getDailyBetHistory/getWeeklyBetHistory결과를 그대로 사용하고, 해당 유틸에서 이미DELETED를 필터링하고 있어서 현재 구조에서는 이 조건이 방어적(중복) 체크에 가깝습니다.
- 의도적으로 “혹시라도 다른 경로에서 DELETED가 들어오는 경우까지 방어한다”는 의미라면, 간단한 주석으로 의도를 남겨 두면 이후 리팩터링 시 혼동을 줄이는 데 도움이 될 것 같습니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/src/components/stockgame/Betting.jsx(1 hunks)frontend/src/utils/bettingHistory.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/src/components/stockgame/Betting.jsx (2)
frontend/src/utils/bettingHistory.js (2)
data(16-16)data(22-22)frontend/src/components/stockgame/BettingHistory.jsx (1)
data(12-12)
1) 작업한 이슈번호
SISC1-222
2) 변경 요약 (What & Why)
3) 스크린샷/동영상 (UI 변경 시)
4) 상세 변경사항 (전부 다)
5) 참고사항
Summary by CodeRabbit
버그 수정
✏️ Tip: You can customize this high-level summary in your review settings.