Skip to content

[FE] SISC1-222 [FIX] : 사용자가 취소한 베팅 필터링#149

Merged
DongEun02 merged 2 commits intomainfrom
SISC1-222-FE-bet-history-status
Nov 27, 2025
Merged

[FE] SISC1-222 [FIX] : 사용자가 취소한 베팅 필터링#149
DongEun02 merged 2 commits intomainfrom
SISC1-222-FE-bet-history-status

Conversation

@DongEun02
Copy link
Contributor

@DongEun02 DongEun02 commented Nov 27, 2025

1) 작업한 이슈번호

SISC1-222

2) 변경 요약 (What & Why)

  • 무엇을 변경했는지: betStatus가 DELETED인 베팅 객체 필터링
  • 변경했는지(문제/목표):

3) 스크린샷/동영상 (UI 변경 시)

전/후 비교, 반응형(모바일/데스크톱) 캡쳐

  • Before:
  • After:

4) 상세 변경사항 (전부 다)

  • 라우팅/페이지:
  • 컴포넌트:
  • 상태관리:
  • API 호출:
  • 스타일:
  • 기타:

5) 참고사항

Summary by CodeRabbit

버그 수정

  • 삭제된 베팅이 현재 베팅 상태 및 베팅 이력에서 올바르게 제외됩니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@DongEun02 DongEun02 requested a review from gxuoo as a code owner November 27, 2025 12:20
@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Walkthrough

두 파일에서 betStatus'DELETED'인 항목을 무시하도록 로직을 수정했습니다. Betting.jsx에서는 베팅 상태 도출 시 삭제된 베팅을 제외하는 조건을 추가했으며, bettingHistory.js에서는 반환 데이터에서 삭제된 항목을 필터링합니다.

Changes

코호트 / 파일 변경 사항 요약
베팅 상태 로직
frontend/src/components/stockgame/Betting.jsx
isBetting 상태 도출 조건에 userBets.betStatus !== 'DELETED' 확인 추가. 삭제된 베팅은 무시하고 'none'으로 폴백
베팅 이력 필터링
frontend/src/utils/bettingHistory.js
betStatus === 'DELETED'인 항목을 필터링하여 제거한 후 데이터 반환. 오류 처리는 유지

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • 두 파일 모두 단순한 필터링/조건 검사 로직 추가
  • 기존 제어 흐름 변경 없이 DELETED 상태 처리만 추가
  • 테스트 케이스가 DELETED 시나리오를 충분히 커버하는지 확인 필요

Possibly related PRs

Suggested reviewers

  • gxuoo

Poem

🐰 삭제된 베팅을 속 하고 쓸어내니,
깔끔해진 기록, 반짝반짝해져라!
조건 하나 추가해 마법처럼 사라지고,
토끼의 승리, 데이터는 이제 더 똑똑하다! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 정확히 반영하고 있습니다. 사용자가 취소한(DELETED 상태의) 베팅을 필터링하는 것이 주요 변경 사항이며, 제목에서 '사용자가 취소한 베팅 필터링'으로 명확히 표현되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch SISC1-222-FE-bet-history-status

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.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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' 조건으로, 삭제된 베팅을 베팅 상태에서 확실히 제외하는 방향은 요구사항에 잘 맞습니다.
  • 다만 userBetsgetDailyBetHistory / getWeeklyBetHistory 결과를 그대로 사용하고, 해당 유틸에서 이미 DELETED를 필터링하고 있어서 현재 구조에서는 이 조건이 방어적(중복) 체크에 가깝습니다.
    • 의도적으로 “혹시라도 다른 경로에서 DELETED가 들어오는 경우까지 방어한다”는 의미라면, 간단한 주석으로 의도를 남겨 두면 이후 리팩터링 시 혼동을 줄이는 데 도움이 될 것 같습니다.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b80c836 and bc43028.

📒 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)

@DongEun02 DongEun02 merged commit ec77fba into main Nov 27, 2025
1 check passed
@DongEun02 DongEun02 deleted the SISC1-222-FE-bet-history-status branch November 27, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant