Skip to content

[공통] 분실물, 공지사항, 콜밴, 동아리 도메인 적용#1206

Merged
ff1451 merged 17 commits intorefactor/#1200/querykey-options-factoryfrom
refactor/#1205/campus-domain
Mar 16, 2026
Merged

[공통] 분실물, 공지사항, 콜밴, 동아리 도메인 적용#1206
ff1451 merged 17 commits intorefactor/#1200/querykey-options-factoryfrom
refactor/#1205/campus-domain

Conversation

@ff1451
Copy link
Contributor

@ff1451 ff1451 commented Mar 12, 2026

Changes 📝

분실물, 공지사항, 콜밴, 동아리 도메인에 queryKey Factory, queryOptions Factory 적용

작업 기준

  • 기본적인 토대는 TkDodo의 글을 보고 작업했습니다.

    • 해당 작업을 통해 useQuery, prefetchQuery 등 여러 곳에서 동일한 값을 사용할 수 있어 중복 및 쿼리키 불일치를 제거할 수 있습니다
  • 공통 read 설정은 src/api/<domain>/queries.ts로 이동했습니다.

  • 공통 write 설정은 src/api/<domain>/mutations.ts로 이동했습니다.

  • queryKey만 분리하지 않고, queryOptions / mutationOptions 단위로 공유하도록 맞췄습니다.

  • SSR prefetchQuery / fetchQuery와 클라이언트 useQuery / useSuspenseQuery가 같은 query factory를 사용하도록 정리했습니다.

  • mutationFn + 공통 invalidate는 factory로 올리고, 토스트/라우팅/모달 닫기 같은 화면 전용 후처리는 hook 또는 호출부에 남겼습니다.

  • UseQueryOptions / UseMutationOptions를 그대로 forwarding하는 저수준 wrapper는 만들지 않았습니다.

  • 단일 query/mutation만 감싸는 thin hook은 제거하거나 직접 호출로 대체했습니다.

  • 여러 query/mutation 조합, 라우팅, local state, polling, storage, domain action을 다루는 workflow hook은 유지했습니다.

  • 기존 동작 보존을 우선으로 했고, API 스펙이나 사용자 플로우 자체는 바꾸지 않았습니다.

의도적으로 남겨둔 것

아래 성격의 hook은 유지했습니다.

  • 여러 query/mutation을 함께 조합하는 hook
  • router, timer, localStorage, IndexedDB, Zustand 같은 외부 상태를 다루는 hook
  • 단순 fetch wrapper가 아니라 domain action 묶음을 제공하는 hook
  • 화면 전용 select / 가공 / fallback 책임이 있는 facade hook

Precaution

✔️ Please check if the PR fulfills these requirements

  • It's submitted to the correct branch, not the develop branch unconditionally?
  • If on a hotfix branch, ensure it targets main?
  • There are no warning message when you run yarn lint

@ff1451 ff1451 self-assigned this Mar 12, 2026
@ff1451 ff1451 added the 🔨 Refactor 코드 리팩토링 label Mar 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • develop
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 58ff0af7-68f6-490b-ac42-dea9760a42fb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#1205/campus-domain

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.

@ff1451 ff1451 changed the base branch from refactor/#1203/timetable-shops to refactor/#1200/querykey-options-factory March 13, 2026 10:47
Copy link

@dh2906 dh2906 left a comment

Choose a reason for hiding this comment

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

👍👍👍👍

Copy link

@taejinn taejinn left a comment

Choose a reason for hiding this comment

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

@ff1451 ff1451 merged commit f51024e into refactor/#1200/querykey-options-factory Mar 16, 2026
2 checks passed
@github-actions github-actions bot deleted the refactor/#1205/campus-domain branch March 16, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants