Skip to content

Fix(audience): 공지 저장 뷰 이미지 오류 해결#339

Merged
jin-evergreen merged 3 commits intodevelopfrom
fix/notice-saved-image/#337
Mar 19, 2026
Merged

Fix(audience): 공지 저장 뷰 이미지 오류 해결#339
jin-evergreen merged 3 commits intodevelopfrom
fix/notice-saved-image/#337

Conversation

@jin-evergreen
Copy link
Copy Markdown
Member

@jin-evergreen jin-evergreen commented Mar 18, 2026

📌 Summary

공지 저장 뷰에서 이미지가 렌더링 되지 않는 문제를 해결합니다.

📚 Tasks

  • 단일 이미지 문자열에서, 배열로 달라진 API 명세에 맞게 타입 및 props 수정

🔍 Describe

공지 저장 뷰 이미지 오류 해결

공지 저장 뷰에서 이미지가 렌더링 되지 않는 문제를 해결했습니다. 기존에는 단일 이미지 문자열을 받아왔으나, 스프린트 기간에 여러 이미지 업로드가 가능해지면서 API 명세가 바뀌었고 그에 따른 수정을 진행했습니다.

저장된 공지를 불러오는 API와 관련한 타입에 한해서, shared 레이어에서 entities로 이동했습니다. 현재 각 파일마다 페이지네이션 타입을 정의해서 사용하고 있어, 중복된 코드가 많습니다. 따라서 기능 개발 후 리팩토링 때 사용할 pagination 타입을 정의했습니다. 현재 전체적인 타입 수정이 이뤄지면 여러 사이드 이펙트가 우려되므로, 기능 개발 후 팀 내 논의를 통해 전면적인 리팩토링을 진행할 예정입니다.

👀 To Reviewer

  • 공지 저장 뷰에서 이미지가 정상적으로 보이는지 확인 부탁드려요!

📸 Screenshot

Before After

@jin-evergreen jin-evergreen requested a review from a team as a code owner March 18, 2026 14:03
@github-actions github-actions bot added 🐛 Fix 버그 및 오류 수정 🐻‍❄️ 진석 labels Mar 18, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 298bc97e-6b63-411a-b8c6-b341e7fdab56

📥 Commits

Reviewing files that changed from the base of the PR and between ab513a4 and 26fa72b.

📒 Files selected for processing (1)
  • apps/audience/src/entities/notice/types/types.ts

📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 저장된 공지사항에서 여러 이미지 지원이 추가되었습니다.
    • 페이지네이션 기능이 개선되었습니다.
  • 개선 사항

    • 저장된 공지사항 조회 시스템이 최적화되었습니다.

Walkthrough

저장된 공지 조회 로직을 features에서 entities로 옮기고 API 헬퍼 및 쿼리 옵션을 도입했습니다. 타입 구조를 정리해 SavedNoticeItem.imageUrlimageUrls 배열로 변경하고 공통 Pagination 타입을 추가했습니다. 기존 쿼리 모듈은 삭제되었습니다.

Changes

Cohort / File(s) Summary
API 레이어 추가
apps/audience/src/entities/notice/api/notice.ts
새로운 getSavedNotices(params) 함수 추가 (END_POINT.GET_SAVED_NOTICES 호출, SavedNoticesResponse 반환).
쿼리 옵션 이동 및 도입
apps/audience/src/entities/notice/model/query-options.ts
SAVED_NOTICES_QUERY_OPTIONS 추가 및 getSavedNotices 임포트로 쿼리Key/쿼리Fn 재구성.
타입 변경 및 공통 타입 추가
apps/audience/src/entities/notice/types/types.ts, apps/audience/src/shared/types/pagination.ts, apps/audience/src/shared/types/index.ts
SavedNoticeItem.imageUrl: stringimageUrls: string[]로 변경, SavedNoticesPagination 제거, 공용 Pagination 인터페이스 추가 및 재수출.
기존 쿼리 모듈 제거
apps/audience/src/features/saved-notice/query.ts
이전 getSavedNoticesSAVED_NOTICES_QUERY_OPTIONS 정의 삭제.
페이지 사용처 업데이트
apps/audience/src/pages/saved-notices/saved-notices.tsx
쿼리 옵션 임포트 경로 변경 및 notice.imageUrlnotice.imageUrls ?? [] 사용으로 렌더링 수정.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

📡 API, ♻️ Refactor

Suggested reviewers

  • Sohyunnnn
  • eunkr82
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 [Fix] 타입을 명시하고 50자 이내의 간결한 한국어로 작성되어 변경 사항의 핵심(이미지 오류 해결)을 명확히 전달하고 있습니다.
Description check ✅ Passed PR 설명은 Issue 참조, 변경 사항의 상세한 맥락, 구체적인 작업 내용, 검토자를 위한 확인 요청 및 Before/After 스크린샷을 포함하여 변경 사항과 밀접하게 관련되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

Copy link
Copy Markdown

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/audience/src/entities/notice/model/query-options.ts`:
- Around line 28-34: SAVED_NOTICES_QUERY_OPTIONS.LIST currently calls
getSavedNotices without supporting AbortSignal, unlike
NOTICES_QUERY_OPTIONS.LIST; update getSavedNotices to accept an options object
(e.g., { signal?: AbortSignal, ...params }) and then change
SAVED_NOTICES_QUERY_OPTIONS.LIST to forward the signal into queryOptions's
queryFn so the AbortSignal passed by react-query (or your queryOptions helper)
cancels the network request; ensure types (PageSizeParams or a new interface)
are updated and queryOptions usage remains consistent.

In `@apps/audience/src/entities/notice/types/types.ts`:
- Line 1: Replace the value import of Pagination with a type-only import to
avoid pulling runtime dependencies into the bundle: change the current import
statement that references Pagination in types.ts to a type-only import (i.e.,
use the TypeScript `import type { Pagination }` form) so the symbol Pagination
is treated purely as a type and stripped from the emitted JS.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8135fa2b-0ca8-495b-8b6d-a0c11faf1853

📥 Commits

Reviewing files that changed from the base of the PR and between 228cdb2 and ab513a4.

📒 Files selected for processing (7)
  • apps/audience/src/entities/notice/api/notice.ts
  • apps/audience/src/entities/notice/model/query-options.ts
  • apps/audience/src/entities/notice/types/types.ts
  • apps/audience/src/features/saved-notice/query.ts
  • apps/audience/src/pages/saved-notices/saved-notices.tsx
  • apps/audience/src/shared/types/index.ts
  • apps/audience/src/shared/types/pagination.ts
💤 Files with no reviewable changes (1)
  • apps/audience/src/features/saved-notice/query.ts

Comment on lines +28 to +34
export const SAVED_NOTICES_QUERY_OPTIONS = {
LIST: (params: PageSizeParams = {}) =>
queryOptions({
queryKey: [...USERS_QUERY_KEY.SAVED_NOTICES(), params],
queryFn: () => getSavedNotices(params),
}),
} as const;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Suggest: AbortSignal 지원 추가를 고려해보세요.

NOTICES_QUERY_OPTIONS.LISTsignal을 전달해서 요청 취소를 지원하는데, SAVED_NOTICES_QUERY_OPTIONS.LIST는 signal을 전달하지 않아요. 사용자가 페이지를 빠르게 이탈할 때 불필요한 네트워크 요청이 계속될 수 있어요.

현재 getSavedNotices 함수가 options를 받지 않아서 signal을 전달할 수 없는 구조인데, 일관성과 UX 개선을 위해 추후 리팩토링 시 고려해주시면 좋을 것 같아요.

♻️ 제안하는 수정 방향 (notice.ts와 query-options.ts 둘 다 수정 필요)

notice.ts:

-export const getSavedNotices = (params: PageSizeParams = {}) =>
-  get<SavedNoticesResponse, PageSizeParams>(
+export const getSavedNotices = (
+  params: PageSizeParams = {},
+  options: RequestOptions = {},
+) =>
+  get<SavedNoticesResponse, PageSizeParams>(
     END_POINT.GET_SAVED_NOTICES,
     params,
+    options,
   );

query-options.ts:

 export const SAVED_NOTICES_QUERY_OPTIONS = {
   LIST: (params: PageSizeParams = {}) =>
     queryOptions({
       queryKey: [...USERS_QUERY_KEY.SAVED_NOTICES(), params],
-      queryFn: () => getSavedNotices(params),
+      queryFn: ({ signal }) => getSavedNotices(params, { signal }),
     }),
 } as const;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/audience/src/entities/notice/model/query-options.ts` around lines 28 -
34, SAVED_NOTICES_QUERY_OPTIONS.LIST currently calls getSavedNotices without
supporting AbortSignal, unlike NOTICES_QUERY_OPTIONS.LIST; update
getSavedNotices to accept an options object (e.g., { signal?: AbortSignal,
...params }) and then change SAVED_NOTICES_QUERY_OPTIONS.LIST to forward the
signal into queryOptions's queryFn so the AbortSignal passed by react-query (or
your queryOptions helper) cancels the network request; ensure types
(PageSizeParams or a new interface) are updated and queryOptions usage remains
consistent.

@jin-evergreen jin-evergreen linked an issue Mar 18, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@Sohyunnnn Sohyunnnn 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
Copy Markdown
Contributor

@eunkr82 eunkr82 left a comment

Choose a reason for hiding this comment

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

확인했습니다! 페이지네이션 타입 정의 너무 좋네요~~ 👍👍

@jin-evergreen jin-evergreen merged commit 95b065d into develop Mar 19, 2026
2 checks passed
@jin-evergreen jin-evergreen deleted the fix/notice-saved-image/#337 branch March 19, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Fix 버그 및 오류 수정 🐻‍❄️ 진석

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 공지 저장 뷰 이미지 오류 해결

3 participants