Skip to content

[FEAT] impact API 오류 수정 - #23

Merged
suwonthugger merged 1 commit into
mainfrom
feat/22-impact-error
Jul 28, 2026
Merged

[FEAT] impact API 오류 수정#23
suwonthugger merged 1 commit into
mainfrom
feat/22-impact-error

Conversation

@suwonthugger

@suwonthugger suwonthugger commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

👥 작업 배경 및 목적

🛠️ 주요 변경 사항

  • app.tsx의 진입 시 자동 선택 로직이 apis/news/mock.ts의 getNews()를 직접 호출해 실 배포 환경에서도 항상 목데이터의 첫 항목 id(10001)로 impact를 요청하고 있었음.
  • useNewsQuery()가 실제로 받아온 뉴스 목록의 첫 항목으로 선택하도록 수정

🧪 테스트 결과 (선택)

  • 로컬 환경 테스트 결과나 실행 화면 스크린샷이 있다면 첨부해 주세요.

Summary by CodeRabbit

  • 버그 수정
    • 뉴스 화면에서 실제 뉴스 쿼리 결과를 기반으로 첫 번째 뉴스가 올바르게 선택되도록 개선했습니다.
    • 뉴스 데이터가 준비되기 전 잘못된 항목이 선택되거나 초기화되는 문제를 수정했습니다.
    • 캐시된 데이터를 활용해 불필요한 중복 요청을 줄였습니다.

app.tsx의 진입 시 자동 선택 로직이 apis/news/mock.ts의 getNews()를 직접
호출해 실 배포 환경에서도 항상 목데이터의 첫 항목 id(10001)로 impact를
요청하고 있었음. useNewsQuery()가 실제로 받아온 뉴스 목록의 첫 항목으로
선택하도록 수정 — 프로덕션에서는 실 백엔드가 내려주는 진짜 첫 뉴스를
따라가고, NewsPanel과 같은 쿼리 키를 써서 중복 요청도 없다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@suwonthugger suwonthugger self-assigned this Jul 28, 2026
@suwonthugger suwonthugger linked an issue Jul 28, 2026 that may be closed by this pull request
1 task
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 99ba1023-6246-4928-a209-21aee7eed544

📥 Commits

Reviewing files that changed from the base of the PR and between 899dd9f and f924de5.

📒 Files selected for processing (1)
  • src/routes/app.tsx

📝 Walkthrough

Walkthrough

뉴스 초기 선택 로직이 모크 getNews() 호출에서 useNewsQuery() 결과 기반으로 변경되었으며, 첫 뉴스 ID가 준비된 경우에만 선택 상태를 초기화합니다.

Changes

뉴스 초기 선택

Layer / File(s) Summary
쿼리 기반 초기화
src/routes/app.tsx
useNewsQuery()의 첫 뉴스 ID를 사용해 selectedNewsId를 조건부 초기화하고, 기존 모크 getNews() 의존성을 제거했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/22-impact-error

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

@suwonthugger
suwonthugger merged commit c0cc095 into main Jul 28, 2026
1 of 2 checks passed
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.

[FEAT] impact API 오류 수정

1 participant