Skip to content

Conversation

@HaeJungg
Copy link
Contributor

@HaeJungg HaeJungg commented Nov 13, 2024

πŸ”– Issue Ticket

#111

✍️ Description

  • 폴더 λ³€κ²½ + 파일 이름 μƒˆλ‘œ μ •ν•œ μ»¨λ²€μ…˜μ— 맞게 μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€
  • 약속 μ°Έκ°€, μ·¨μ†Œ(μ‚­μ œ), μ°Έμ—¬ μ·¨μ†Œ apiμž…λ‹ˆλ‹€!
  • ν¬μŠ€νŠΈλ§¨μœΌλ‘œλŠ” api λ™μž‘μ€ μž˜ν•˜λŠ”κ±°κ°™μ€λ° 아직 devμ—μ„œλŠ” λ‘œκ·ΈμΈν›„ 토큰이 μ•ˆλ‹΄κ²¨μ„œ μ˜¬λ°”λ₯Έ μš”μ²­ λ˜λŠ”μ§€ κΉŒμ§€λ§Œ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€

βœ… Checklist

PR

  • Branch Convention 확인

    feat/ 피쳐, fix/ 버그 μˆ˜μ •, refactor/ κ°œμ„ 

  • Base Branch 확인
  • μ μ ˆν•œ Label μ§€μ •
  • Assignee 및 Reviewer μ§€μ •

Test

  • 둜컬 μž‘λ™ 확인

Summary by CodeRabbit

  • New Features

    • μƒˆλ‘œμš΄ API κΈ°λŠ₯ μΆ”κ°€: λͺ¨μž„ 세뢀정보 쑰회, μ°Έμ—¬, μ·¨μ†Œ 및 νƒˆν‡΄ κΈ°λŠ₯.
    • GatheringDetailType에 crewId 속성 μΆ”κ°€λ‘œ λͺ¨μž„ μ •λ³΄μ˜ 세뢀사항 ν–₯상.
  • Bug Fixes

    • 였λ₯˜ 처리 둜직 κ°œμ„ : crew 정보가 없을 경우 μ‚¬μš©μžμ—κ²Œ λͺ…ν™•ν•œ λ©”μ‹œμ§€ 제곡.
  • Documentation

    • μŠ€ν† λ¦¬ μ •μ˜μ— crewId 속성 μΆ”κ°€λ‘œ λͺ¨μž„ 세뢀정보에 λŒ€ν•œ ν…ŒμŠ€νŠΈ 데이터 κ°•ν™”.
  • Refactor

    • API λͺ¨λ“ˆ ꡬ쑰 변경에 따라 μ—¬λŸ¬ 파일의 import 경둜 μˆ˜μ •.

@HaeJungg HaeJungg linked an issue Nov 13, 2024 that may be closed by this pull request
4 tasks
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2024

Walkthrough

이 ν’€ λ¦¬ν€˜μŠ€νŠΈλŠ” μ—¬λŸ¬ νŒŒμΌμ—μ„œ 비동기 ν•¨μˆ˜μ™€ API ν˜ΈμΆœμ„ μΆ”κ°€ν•˜κ±°λ‚˜ μ œκ±°ν•˜λŠ” λ‚΄μš©μ„ ν¬ν•¨ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. get-gathering-detail.ts 및 get-review-list.ts 파일이 μ‚­μ œλ˜μ—ˆμœΌλ©°, λŒ€μ‹  gathering-detail-apis.ts 파일이 μΆ”κ°€λ˜μ–΄ λͺ¨μž„ 세뢀정보λ₯Ό κ΄€λ¦¬ν•˜λŠ” μ—¬λŸ¬ 비동기 ν•¨μˆ˜κ°€ ν¬ν•¨λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ, λ‹€μ–‘ν•œ μ»΄ν¬λ„ŒνŠΈμ—μ„œ API 호좜 κ²½λ‘œκ°€ λ³€κ²½λ˜μ—ˆκ³ , 일뢀 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μƒνƒœ 관리 및 λ Œλ”λ§ 둜직이 μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Changes

파일 경둜 λ³€κ²½ μš”μ•½
src/_apis/detail/get-gathering-detail.ts 비동기 ν•¨μˆ˜ GetGatheringDetail 제거
src/_apis/detail/get-review-list.ts ReviewRateInfo, ReviewListData μΈν„°νŽ˜μ΄μŠ€ 및 getReviewList ν•¨μˆ˜ 제거
src/_apis/gathering/gathering-detail-apis.ts GetGatheringDetail, JoinGathering, CancelGathering, LeaveGathering ν•¨μˆ˜ μΆ”κ°€
src/_queries/crew/crew-detail-queries.ts getCrewDetail의 μž„ν¬νŠΈ 경둜 λ³€κ²½
src/_queries/crew/gathering-list-queries.ts getGatheringList의 μž„ν¬νŠΈ 경둜 λ³€κ²½
src/_queries/gathering/gathering-detail-queries.ts GetGatheringDetail의 μž„ν¬νŠΈ 경둜 λ³€κ²½
src/app/(crew)/crew/_components/gathering-detail-modal/container.tsx handleJoin, handleExit, handleDelete, showToast ν•¨μˆ˜ μΆ”κ°€
src/app/(crew)/crew/_components/gathering-detail-modal/gathering-detail-modal.stories.tsx crewId 속성 μΆ”κ°€
src/app/(crew)/crew/detail/[id]/_components/detail-crew-section.tsx useGetCrewDetailQuery의 μž„ν¬νŠΈ 경둜 λ³€κ²½ 및 μ—λŸ¬ 처리 둜직 μˆ˜μ •
src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx useGetGatheringListQuery의 μž„ν¬νŠΈ 경둜 λ³€κ²½
src/app/(crew)/crew/detail/[id]/_components/review-section.tsx 리뷰 데이터 관리 둜직 제거 및 정적 λ ˆμ΄μ•„μ›ƒμœΌλ‘œ λ³€κ²½
src/app/(crew)/crew/detail/[id]/page.tsx getGatheringList의 μž„ν¬νŠΈ 경둜 λ³€κ²½
src/components/common/gathering-card/container.tsx useGetGatheringDetailQuery의 μž„ν¬νŠΈ 경둜 λ³€κ²½
src/components/common/gathering-card/scheduled-gathering-card/container.tsx crewId 속성 μΆ”κ°€
src/types/gathering-data.d.ts GatheringDetailType μΈν„°νŽ˜μ΄μŠ€μ— crewId 속성 μΆ”κ°€

Possibly related PRs

  • Feat/96/formΒ #97: 이 PR은 GetGatheringDetail ν•¨μˆ˜λ₯Ό μΆ”κ°€ν•˜μ—¬ 메인 PRμ—μ„œ 제거된 GetGatheringDetail ν•¨μˆ˜μ™€ μ§μ ‘μ μœΌλ‘œ 관련이 μžˆμŠ΅λ‹ˆλ‹€.
  • DetailPage api μ—°κ²°Β #114: 이 PR은 μƒˆλ‘œμš΄ GetGatheringDetail ν•¨μˆ˜λ₯Ό λ„μž…ν•˜μ—¬ μ›λž˜μ˜ GetGatheringDetail ν•¨μˆ˜κ°€ 제거된 메인 PRκ³Ό μ§μ ‘μ μœΌλ‘œ 관련이 μžˆμŠ΅λ‹ˆλ‹€.

Suggested labels

fix

Suggested reviewers

  • Rangbyeolang
  • User850413
  • minkyung5x5

🐰 λ³€ν™”μ˜ μ†Œμ‹, κ·€μ—¬μš΄ 토끼가 μ „ν•΄μš”!
μƒˆλ‘œμš΄ κΈ°λŠ₯이 μΆ”κ°€λ˜κ³ ,
였래된 것은 사라져가넀.
λͺ¨μž„μ˜ 세뢀정보,
이제 더 μ‰½κ²Œ 찾을 수 μžˆμ–΄μš”!
ν•¨κ»˜ μ¦κ²¨μš”, 우리 λͺ¨λ‘! 🌟

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

πŸ”§ eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/_apis/gathering/gathering-detail-apis.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't determine the plugin "react-hooks" uniquely.

  • /node_modules/eslint-plugin-react-hooks/index.js (loaded in ".eslintrc.js")
  • /node_modules/eslint-config-next/node_modules/eslint-plugin-react-hooks/index.js (loaded in ".eslintrc.js Β» eslint-config-next/core-web-vitals Β» /node_modules/eslint-config-next/index.js Β» plugin:react-hooks/recommended")

Please remove the "plugins" setting from either config or remove either plugin installation.

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HaeJungg HaeJungg self-assigned this Nov 13, 2024
@HaeJungg HaeJungg added the api label Nov 13, 2024
@github-actions
Copy link

@github-actions
Copy link

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: 4

🧹 Outside diff range and nitpick comments (12)
src/_queries/crew/gathering-list-queries.ts (1)

Line range hint 5-11: μ—λŸ¬ 처리 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

useQuery ν›…μ—μ„œ μ—λŸ¬ 상황에 λŒ€ν•œ μ²˜λ¦¬κ°€ λ―Έν‘ν•©λ‹ˆλ‹€. μ‚¬μš©μž κ²½ν—˜ ν–₯상을 μœ„ν•΄ μ—λŸ¬ 처리λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•΄λ³΄μ„Έμš”:

 export function useGetGatheringListQuery(id: number) {
   return useQuery<GatheringType[], Error>({
     queryKey: ['gatheringList', id],
     queryFn: () => getGatheringList(id),
     enabled: !!id,
+    retry: 1,
+    onError: (error) => {
+      console.error('λͺ¨μž„ λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€:', error);
+    }
   });
 }
src/app/(crew)/crew/detail/[id]/_components/detail-crew-section.tsx (3)

Line range hint 16-16: TODO 주석 μ—…λ°μ΄νŠΈκ°€ ν•„μš”ν•©λ‹ˆλ‹€

ν˜„μž¬ κ΅¬ν˜„λœ μ—λŸ¬ μ²˜λ¦¬κ°€ 이미 μΆ©λΆ„νžˆ 견고해 λ³΄μž…λ‹ˆλ‹€. 이 TODO 주석이 μ—¬μ „νžˆ ν•„μš”ν•œμ§€ κ²€ν† ν•΄ μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€.


Line range hint 18-31: μ—λŸ¬ λ©”μ‹œμ§€ μƒμˆ˜ν™”λ₯Ό μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€

μ—λŸ¬ 처리 둜직이 잘 κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. λ‹€λ§Œ, μ—λŸ¬ λ©”μ‹œμ§€λ₯Ό μƒμˆ˜λ‘œ λΆ„λ¦¬ν•˜λ©΄ μœ μ§€λ³΄μˆ˜κ°€ λ”μš± μš©μ΄ν•΄μ§ˆ 것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 방식을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

+const ERROR_MESSAGES = {
+  NOT_FOUND: '크루 정보λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€',
+  DEFAULT: '데이터 톡신에 μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.',
+};

 if (error) {
   if (error instanceof ApiError) {
     try {
       const errorData = JSON.parse(error.message);

       if (errorData.status === 'NOT_FOUND') {
-        return <p>크루 정보λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€</p>;
+        return <p>{ERROR_MESSAGES.NOT_FOUND}</p>;
       }
     } catch {
       return <p>{`Error ${error.status}: ${error.message}`}</p>;
     }
   }
-  return <p>데이터 톡신에 μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.</p>;
+  return <p>{ERROR_MESSAGES.DEFAULT}</p>;
 }

Line range hint 34-34: λ‘œλ”© μƒνƒœ κ°œμ„ μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€

ν˜„μž¬ κ΅¬ν˜„μ€ 잘 λ˜μ–΄μžˆμ§€λ§Œ, μ‚¬μš©μž κ²½ν—˜ ν–₯상을 μœ„ν•΄ λ‘œλ”© μƒνƒœμ— μŠ€μΌˆλ ˆν†€ UIλ‚˜ 더 μ„Έλ ¨λœ λ‘œλ”© μ»΄ν¬λ„ŒνŠΈλ₯Ό μ μš©ν•˜λŠ” 것을 κ³ λ €ν•΄λ³΄μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

src/app/(crew)/crew/detail/[id]/page.tsx (1)

Line range hint 29-29: 주석 처리된 μ»΄ν¬λ„ŒνŠΈ 및 TODO ν•­λͺ© μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

CreateGathering μ»΄ν¬λ„ŒνŠΈμ™€ 리뷰 μ„Ήμ…˜μ΄ 주석 μ²˜λ¦¬λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 주석 처리된 μ½”λ“œμ™€ TODO ν•­λͺ©μ— λŒ€ν•œ ν–₯ν›„ κ³„νšμ΄λ‚˜ κ΅¬ν˜„ 일정을 λͺ…ν™•νžˆ ν•΄μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€.

이 κΈ°λŠ₯λ“€μ˜ κ΅¬ν˜„μ„ μœ„ν•œ 이슈λ₯Ό μƒμ„±ν•΄λ“œλ¦΄κΉŒμš”? λ˜λŠ” κ΅¬ν˜„μ— 도움이 ν•„μš”ν•˜μ‹ κ°€μš”?

Also applies to: 35-41

src/app/(crew)/crew/_components/gathering-detail-modal/container.tsx (1)

26-28: Toast μœ ν‹Έλ¦¬ν‹° ν•¨μˆ˜μ˜ μž¬μ‚¬μš©μ„± κ°œμ„ μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€.

ν˜„μž¬ μ»΄ν¬λ„ŒνŠΈ 내뢀에 μ •μ˜λœ showToast ν•¨μˆ˜λ₯Ό λ³„λ„μ˜ μœ ν‹Έλ¦¬ν‹°λ‘œ λΆ„λ¦¬ν•˜λ©΄ μž¬μ‚¬μš©μ„±μ΄ ν–₯상될 것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 λ¦¬νŒ©ν† λ§μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

-  const showToast = (message: string, type: 'success' | 'error' | 'warning') => {
-    Toast({ message, type });
-  };

μƒˆλ‘œμš΄ μœ ν‹Έλ¦¬ν‹° 파일 src/utils/toast.ts:

export const showToast = (message: string, type: 'success' | 'error' | 'warning') => {
  Toast({ message, type });
};
src/components/common/gathering-card/scheduled-gathering-card/container.tsx (3)

Line range hint 19-20: API 톡합 μž‘μ—… μ™„λ£Œ ν•„μš”

ν˜„μž¬ λ‹€μŒκ³Ό 같은 κ΅¬ν˜„μ΄ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€:

  1. λͺ¨μž„ 상세 정보 쑰회 API 연동
  2. μ’‹μ•„μš” ν† κΈ€ κΈ°λŠ₯ κ΅¬ν˜„
  3. 데이터 리페치 둜직

PR μ„€λͺ…에 λ”°λ₯΄λ©΄ 둜그인 토큰 문제둜 API ν…ŒμŠ€νŠΈκ°€ μ™„μ „νžˆ 이루어지지 μ•Šμ•˜λ‹€κ³  ν•©λ‹ˆλ‹€. 이 λ¬Έμ œκ°€ ν•΄κ²°λœ ν›„ API 톡합을 μ™„λ£Œν•΄μ£Όμ„Έμš”.

API 톡합 μž‘μ—…μ— 도움이 ν•„μš”ν•˜μ‹œλ‹€λ©΄ 말씀해 μ£Όμ„Έμš”.

Also applies to: 66-69, 71-73


Line range hint 16-95: μ»΄ν¬λ„ŒνŠΈ κ°œμ„  μ œμ•ˆ

ν˜„μž¬ ꡬ쑰에 λ‹€μŒ 사항듀을 μΆ”κ°€ν•˜λ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

  1. API 호좜 μ‹œ λ‘œλ”© μƒνƒœ 관리
  2. μ—λŸ¬ 처리 둜직 μΆ”κ°€
  3. API 응닡 νƒ€μž… μ •μ˜ (GatheringDetailType μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€)

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

interface GatheringDetailType {
  crewId: number;
  id: number;
  title: string;
  // ... 기타 ν•„μš”ν•œ ν•„λ“œ
}

// λ‘œλ”© 및 μ—λŸ¬ μƒνƒœ 관리 μ˜ˆμ‹œ
const { data: modalData, isLoading, error } = useQuery<GatheringDetailType>(...);

// μ»΄ν¬λ„ŒνŠΈ λ‚΄λΆ€
if (isLoading) return <LoadingSpinner />;
if (error) return <ErrorMessage />;

더미 데이터 μ‚¬μš© 확인 μ™„λ£Œ

src/components/common/gathering-card/scheduled-gathering-card/container.tsx 파일 λ‚΄μ—μ„œ dummyModalDataκ°€ μ‚¬μš©λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ‹€μ œ API κ΅¬ν˜„ μ‹œ ν•΄λ‹Ή 더미 데이터λ₯Ό μ œκ±°ν•˜κ³  API 데이터λ₯Ό 연동해야 ν•©λ‹ˆλ‹€.

  • dummyModalData μ‚¬μš© μœ„μΉ˜:
    • 라인 27: const dummyModalData = {
    • 라인 29: {dummyModalData && (
    • 라인 31: data={dummyModalData}
πŸ”— Analysis chain

Line range hint 27-65: 더미 데이터λ₯Ό μ‹€μ œ API κ΅¬ν˜„μœΌλ‘œ ꡐ체 ν•„μš”

더미 데이터가 API 응닡 ν˜•μ‹κ³Ό μΌμΉ˜ν•˜μ§€λ§Œ, ν”„λ‘œλ•μ…˜ μ½”λ“œμ—μ„œ ν•˜λ“œμ½”λ”©λœ 데이터λ₯Ό μ‚¬μš©ν•˜λŠ” 것은 λ°”λžŒμ§ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. API 톡합이 μ™„λ£Œλ˜λ©΄ 이 뢀뢄을 μ œκ±°ν•΄μ•Ό ν•©λ‹ˆλ‹€.

λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ λ‹€λ₯Έ μ»΄ν¬λ„ŒνŠΈμ—μ„œλ„ λΉ„μŠ·ν•œ 더미 데이터가 μ‚¬μš©λ˜κ³  μžˆλŠ”μ§€ ν™•μΈν•˜κ² μŠ΅λ‹ˆλ‹€:


더미 데이터 μ‚¬μš© μ—¬λΆ€ μΆ”κ°€ 확인을 μœ„ν•œ 슀크립트 μ‹€ν–‰ ν•„μš”

이전 μŠ€ν¬λ¦½νŠΈμ—μ„œ 'tsx' 파일 μœ ν˜•μ„ μΈμ‹ν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ 'dummyModalData' λ˜λŠ” 'dummy'κ°€ μ‚¬μš©λœ μœ„μΉ˜λ₯Ό ν™•μΈν•΄μ£Όμ„Έμš”.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 더미 데이터 μ‚¬μš© μ—¬λΆ€ 확인
rg -t tsx "dummyModalData|dummy" src/

Length of output: 67


Script:

#!/bin/bash
# 더미 데이터 μ‚¬μš© μ—¬λΆ€ 확인을 μœ„ν•œ μˆ˜μ •λœ 슀크립트
rg "dummyModalData|dummy" --glob "*.tsx" src/

Length of output: 361

src/components/common/gathering-card/container.tsx (1)

Line range hint 52-65: μ—λŸ¬ 처리 둜직 κ°œμ„ μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€.

ν˜„μž¬ μ—λŸ¬ 처리 κ΅¬ν˜„μ΄ 잘 λ˜μ–΄μžˆμ§€λ§Œ, λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ κ³ λ €ν•΄λ³΄μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

  1. μ—λŸ¬ λ©”μ‹œμ§€λ₯Ό 더 ꡬ체적으둜 제곡
  2. μΌμ‹œμ μΈ λ„€νŠΈμ›Œν¬ 였λ₯˜μ— λŒ€ν•œ μž¬μ‹œλ„ 둜직 μΆ”κ°€

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•΄λ³΄μ‹œλŠ” 건 μ–΄λ–¨κΉŒμš”?:

 useEffect(() => {
   if (error) {
     if (error instanceof ApiError) {
       try {
         const errorData = JSON.parse(error.message);

         if (errorData.status === 'NOT_FOUND') {
-          Toast({ message: 'λͺ¨μž„ 정보λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.', type: 'error' });
+          Toast({ 
+            message: `λͺ¨μž„ ID ${id}에 λŒ€ν•œ 정보λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€. μ‚­μ œλ˜μ—ˆκ±°λ‚˜ μ ‘κ·Ό κΆŒν•œμ΄ 없을 수 μžˆμŠ΅λ‹ˆλ‹€.`, 
+            type: 'error' 
+          });
         }
       } catch {
-        Toast({ message: `Error ${error.status}: ${error.message}`, type: 'error' });
+        Toast({ 
+          message: `μ„œλ²„ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€ (${error.status}). μž μ‹œ ν›„ λ‹€μ‹œ μ‹œλ„ν•΄μ£Όμ„Έμš”.`, 
+          type: 'error' 
+        });
       }
     } else {
-      Toast({ message: '데이터 톡신에 μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.', type: 'error' });
+      Toast({ 
+        message: 'λ„€νŠΈμ›Œν¬ 연결을 ν™•μΈν•΄μ£Όμ„Έμš”. λ¬Έμ œκ°€ μ§€μ†λ˜λ©΄ μƒˆλ‘œκ³ μΉ¨μ„ ν•΄μ£Όμ„Έμš”.', 
+        type: 'error' 
+      });
     }
   }
 }, [error, id]);
src/app/(crew)/crew/_components/gathering-detail-modal/gathering-detail-modal.stories.tsx (2)

58-58: λͺ¨λ“  μŠ€ν† λ¦¬μ—μ„œ λ™μΌν•œ crewId κ°’ μ‚¬μš©μ— λŒ€ν•œ κ²€ν†  ν•„μš”

λͺ¨λ“  μŠ€ν† λ¦¬μ—μ„œ crewId: 1둜 λ™μΌν•œ 값을 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‹€μ–‘ν•œ μ‹œλ‚˜λ¦¬μ˜€λ₯Ό ν…ŒμŠ€νŠΈν•˜κΈ° μœ„ν•΄μ„œλŠ” 각기 λ‹€λ₯Έ crewId κ°’μœΌλ‘œ μŠ€ν† λ¦¬λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 각 μŠ€ν† λ¦¬λ³„λ‘œ λ‹€λ₯Έ crewId 값을 μ‚¬μš©ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

// ModalWithUser
-    crewId: 1,
+    crewId: 101,

// ModalWithCaptain
-    crewId: 1,
+    crewId: 102,

// ModalWithCrew
-    crewId: 1,
+    crewId: 103,

Also applies to: 101-101, 144-144


Line range hint 58-90: ν…ŒμŠ€νŠΈ λ°μ΄ν„°μ˜ 이메일 쀑볡 μˆ˜μ • ν•„μš”

각 μŠ€ν† λ¦¬μ˜ μ°Έκ°€μž λ°μ΄ν„°μ—μ„œ λͺ¨λ“  이메일이 '[email protected]'둜 λ™μΌν•˜κ²Œ μ„€μ •λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ‹€μ œ μ‚¬μš© 사둀λ₯Ό 더 잘 λ°˜μ˜ν•˜κ³  ν…ŒμŠ€νŠΈμ˜ 신뒰성을 높이기 μœ„ν•΄ 각기 λ‹€λ₯Έ 이메일을 μ‚¬μš©ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

각 μ°Έκ°€μžλ³„λ‘œ κ³ μœ ν•œ 이메일을 μ‚¬μš©ν•˜λ„λ‘ μˆ˜μ •μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

participants: [
  {
    id: 1,
    profileImageUrl: '...',
    nickname: '럽윈즈올',
-   email: '[email protected]',
+   email: '[email protected]',
  },
  {
    id: 2,
    profileImageUrl: '...',
    nickname: 'λͺ¨λ‹λŸ¬λ„ˆ',
-   email: '[email protected]',
+   email: '[email protected]',
  },
  // ... λ‹€λ₯Έ μ°Έκ°€μžλ“€λ„ 같은 λ°©μ‹μœΌλ‘œ μˆ˜μ •
]

Also applies to: 101-133, 144-176

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a8816c8 and 6591a88.

πŸ“’ Files selected for processing (15)
  • src/_apis/detail/get-gathering-detail.ts (0 hunks)
  • src/_apis/detail/get-review-list.ts (0 hunks)
  • src/_apis/gathering/gathering-detail-apis.ts (1 hunks)
  • src/_queries/crew/crew-detail-queries.ts (1 hunks)
  • src/_queries/crew/gathering-list-queries.ts (1 hunks)
  • src/_queries/gathering/gathering-detail-queries.ts (1 hunks)
  • src/app/(crew)/crew/_components/gathering-detail-modal/container.tsx (2 hunks)
  • src/app/(crew)/crew/_components/gathering-detail-modal/gathering-detail-modal.stories.tsx (3 hunks)
  • src/app/(crew)/crew/detail/[id]/_components/detail-crew-section.tsx (1 hunks)
  • src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx (1 hunks)
  • src/app/(crew)/crew/detail/[id]/_components/review-section.tsx (1 hunks)
  • src/app/(crew)/crew/detail/[id]/page.tsx (1 hunks)
  • src/components/common/gathering-card/container.tsx (1 hunks)
  • src/components/common/gathering-card/scheduled-gathering-card/container.tsx (1 hunks)
  • src/types/gathering-data.d.ts (1 hunks)
πŸ’€ Files with no reviewable changes (2)
  • src/_apis/detail/get-gathering-detail.ts
  • src/_apis/detail/get-review-list.ts
βœ… Files skipped from review due to trivial changes (1)
  • src/app/(crew)/crew/detail/[id]/_components/review-section.tsx
πŸ”‡ Additional comments (15)
src/_queries/crew/crew-detail-queries.ts (2)

Line range hint 4-9: ν›Œλ₯­ν•œ React Query κ΅¬ν˜„μž…λ‹ˆλ‹€

useGetCrewDetailQuery 훅이 React Query의 λͺ¨λ²” 사둀λ₯Ό 잘 λ”°λ₯΄κ³  μžˆμŠ΅λ‹ˆλ‹€:

  • λͺ…ν™•ν•œ 쿼리 ν‚€ ꡬ쑰
  • νƒ€μž… μ•ˆμ •μ„± 확보
  • κ°„κ²°ν•˜κ³  μž¬μ‚¬μš© κ°€λŠ₯ν•œ κ΅¬ν˜„

2-2: API 경둜 ꡬ쑰 λ³€κ²½ 확인 ν•„μš”

API κ²½λ‘œκ°€ 더 논리적인 ꡬ쑰둜 λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. crew κ΄€λ ¨ API듀을 ν•˜λ‚˜μ˜ λ””λ ‰ν† λ¦¬λ‘œ κ΅¬μ„±ν•œ 것은 쒋은 λ³€ν™”μž…λ‹ˆλ‹€.

μƒˆλ‘œμš΄ API ꡬ쑰가 μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆλŠ”μ§€ ν™•μΈν•˜κ² μŠ΅λ‹ˆλ‹€:

βœ… Verification successful

API 경둜 λ³€κ²½ 확인 μ™„λ£Œ

μƒˆλ‘œμš΄ API ꡬ쑰가 μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆμœΌλ©°, 이전 API νŒŒμΌλ“€μ΄ λͺ¨λ‘ μ‚­μ œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: crew κ΄€λ ¨ APIλ“€μ˜ μƒˆλ‘œμš΄ ꡬ쑰 확인

# crew κ΄€λ ¨ API νŒŒμΌλ“€μ˜ μœ„μΉ˜ 확인
fd -e ts -p "crew.*apis\.ts$" src/_apis

# 이전 ꡬ쑰의 파일이 λ‚¨μ•„μžˆλŠ”μ§€ 확인
fd -e ts -p "get-crew.*\.ts$" src/_apis/detail

Length of output: 272


Script:

#!/bin/bash
# Description: 이전 crew κ΄€λ ¨ API νŒŒμΌλ“€μ΄ μ‚­μ œλ˜μ—ˆλŠ”μ§€ 확인

# 이전 ꡬ쑰의 νŒŒμΌλ“€μ΄ μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ”μ§€ 확인
fd -e ts -p "get-crew.*\.ts$" src/_apis | wc -l

Length of output: 51

src/_queries/gathering/gathering-detail-queries.ts (2)

Line range hint 4-9: ν›Œλ₯­ν•œ React Query κ΅¬ν˜„

  • μ μ ˆν•œ νƒ€μž… μ§€μ •
  • μ˜μ‘΄μ„±μ„ ν¬ν•¨ν•œ λͺ…ν™•ν•œ 쿼리 ν‚€ ꡬ쑰
  • κΉ”λ”ν•œ ν•¨μˆ˜ν˜• κ΅¬ν˜„

λͺ¨λ²”적인 React Query νŒ¨ν„΄μ„ 잘 λ”°λ₯΄κ³  μžˆμŠ΅λ‹ˆλ‹€.


2-2: API 파일 ꡬ쑰 λ³€κ²½ 확인 ν•„μš”

API κ΄€λ ¨ νŒŒμΌλ“€μ˜ ꡬ쑰가 더 μ²΄κ³„μ μœΌλ‘œ κ°œμ„ λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ‹€λ§Œ, μ΄λŸ¬ν•œ 변경이 λ‹€λ₯Έ νŒŒμΌλ“€μ—λ„ μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆλŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ API 파일 ꡬ쑰의 일관성을 ν™•μΈν•˜κ² μŠ΅λ‹ˆλ‹€:

βœ… Verification successful

API 파일 ꡬ쑰 변경이 μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: API 파일 ꡬ쑰의 일관성 확인

# 이전 ꡬ쑰의 파일이 λ‚¨μ•„μžˆλŠ”μ§€ 확인
echo "이전 ꡬ쑰의 파일 확인:"
fd -e ts -p "_apis/detail/"

# μƒˆλ‘œμš΄ ꡬ쑰의 νŒŒμΌλ“€ 확인
echo "\nμƒˆλ‘œμš΄ ꡬ쑰의 νŒŒμΌλ“€ 확인:"
fd -e ts -p "_apis/gathering/"

Length of output: 185

src/_queries/crew/gathering-list-queries.ts (1)

2-2: API 경둜 변경이 μ˜¬λ°”λ₯΄κ²Œ μ μš©λ˜μ—ˆλŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

import κ²½λ‘œκ°€ crew λ„€μž„μŠ€νŽ˜μ΄μŠ€λ‘œ μ΄λ™λœ 것이 ν™•μΈλ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ‹€λ₯Έ νŒŒμΌλ“€μ—μ„œλ„ λ™μΌν•œ 변경이 ν•„μš”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ κΈ°μ‘΄ import 경둜λ₯Ό μ‚¬μš©ν•˜λŠ” λ‹€λ₯Έ νŒŒμΌλ“€μ„ ν™•μΈν•΄λ³΄μ„Έμš”:

βœ… Verification successful

API 경둜 변경이 μ˜¬λ°”λ₯΄κ²Œ μ μš©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining old import paths
rg "@/src/_apis/detail/get-gathering-list"

Length of output: 42

src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx (2)

Line range hint 1-20: μ½”λ“œ ꡬ쑰가 잘 κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

  • μ μ ˆν•œ νƒ€μž… μ •μ˜μ™€ ν•¨κ»˜ ν΄λΌμ΄μ–ΈνŠΈ μ»΄ν¬λ„ŒνŠΈλ‘œ μ˜¬λ°”λ₯΄κ²Œ μ„€μ •λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
  • λ‘œλ”©, μ—λŸ¬, 빈 데이터 μƒνƒœμ— λŒ€ν•œ μ²˜λ¦¬κ°€ 잘 λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
  • Props μΈν„°νŽ˜μ΄μŠ€κ°€ λͺ…ν™•ν•˜κ²Œ μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

3-3: API 경둜 λ³€κ²½ 검증이 ν•„μš”ν•©λ‹ˆλ‹€.

import κ²½λ‘œκ°€ detailμ—μ„œ crew둜 λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ΄λŠ” API ꡬ쑰 κ°œμ„ μ˜ μΌν™˜μœΌλ‘œ λ³΄μ΄λ‚˜, λ‹€λ₯Έ μ»΄ν¬λ„ŒνŠΈλ“€λ„ 이 변경사항과 일관성이 μžˆλŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

βœ… Verification successful

경둜 변경이 μΌκ΄€λ˜κ²Œ λ°˜μ˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: ν”„λ‘œμ νŠΈ λ‚΄μ˜ gathering-list-queries κ΄€λ ¨ import 경둜 일관성 검증

# 이전 경둜 μ‚¬μš© μ—¬λΆ€ 확인
echo "이전 경둜 μ‚¬μš© 검사:"
rg -l "@/src/_queries/detail/gathering-list-queries"

# μƒˆλ‘œμš΄ 경둜 μ‚¬μš© 확인
echo "\nμƒˆλ‘œμš΄ 경둜 μ‚¬μš© 검사:"
rg -l "@/src/_queries/crew/gathering-list-queries"

Length of output: 250


Script:

#!/bin/bash
# Description: μƒˆλ‘œμš΄ import 경둜 μ‚¬μš© ν˜„ν™© μΆ”κ°€ 검증

echo "μƒˆλ‘œμš΄ 경둜 전체 μ‚¬μš© 검사:"
rg -l "@/src/_queries/crew/gathering-list-queries"

Length of output: 164

src/app/(crew)/crew/detail/[id]/_components/detail-crew-section.tsx (1)

3-5: μž„ν¬νŠΈ ꡬ쑰가 κ°œμ„ λ˜μ—ˆμŠ΅λ‹ˆλ‹€!

API κ΄€λ ¨ 쿼리λ₯Ό crew ν΄λ”λ‘œ μ΄λ™ν•˜μ—¬ 더 λͺ…ν™•ν•œ ꡬ쑰λ₯Ό κ°€μ§€κ²Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

src/types/gathering-data.d.ts (2)

15-15: crewId ν•„λ“œ μΆ”κ°€κ°€ μ μ ˆν•΄ λ³΄μž…λ‹ˆλ‹€.

λͺ¨μž„κ³Ό 크루의 관계λ₯Ό λͺ…ν™•ν•˜κ²Œ ν‘œν˜„ν•˜κΈ° μœ„ν•œ ν•„μˆ˜μ μΈ ν•„λ“œμ΄λ©°, νƒ€μž…λ„ μ μ ˆν•˜κ²Œ μ§€μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.


15-15: crewId ν•„λ“œ μ‚¬μš© 검증이 ν•„μš”ν•©λ‹ˆλ‹€.

μƒˆλ‘œ μΆ”κ°€λœ ν•„λ“œκ°€ API κ΅¬ν˜„μ—μ„œ μ˜¬λ°”λ₯΄κ²Œ μ‚¬μš©λ˜λŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

βœ… Verification successful

crewId ν•„λ“œ μ‚¬μš©μ΄ API κ΅¬ν˜„μ—μ„œ μ˜¬λ°”λ₯΄κ²Œ ν™•μΈλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: API κ΅¬ν˜„μ—μ„œ crewId ν•„λ“œμ˜ μ‚¬μš©μ„ ν™•μΈν•©λ‹ˆλ‹€.

# API κ΄€λ ¨ νŒŒμΌμ—μ„œ crewId μ‚¬μš© 확인
echo "API νŒŒμΌμ—μ„œ crewId μ‚¬μš© 확인:"
rg -p "crewId" --type ts src/api/

# μ»΄ν¬λ„ŒνŠΈμ—μ„œ crewId μ‚¬μš© 확인
echo "\nμ»΄ν¬λ„ŒνŠΈμ—μ„œ crewId μ‚¬μš© 확인:"
rg -p "crewId.*GatheringDetail" --type tsx src/components/

Length of output: 281


Script:

#!/bin/bash
# Description: 전체 μ½”λ“œλ² μ΄μŠ€μ—μ„œ crewId ν•„λ“œμ˜ μ‚¬μš©μ„ μž¬ν™•μΈν•©λ‹ˆλ‹€.

# 전체 μ½”λ“œλ² μ΄μŠ€μ—μ„œ crewId μ‚¬μš© 확인
echo "전체 μ½”λ“œλ² μ΄μŠ€μ—μ„œ crewId μ‚¬μš© 확인:"
rg "crewId"

# API λ””λ ‰ν† λ¦¬μ˜ μ •ν™•ν•œ 경둜 μ°ΎκΈ°
echo "\nAPI 디렉토리 검색:"
fd api --type d

# components λ””λ ‰ν† λ¦¬μ—μ„œ tsx 파일 지원 μ„€μ • ν›„ crewId μ‚¬μš© 확인
echo "\ncomponents λ””λ ‰ν† λ¦¬μ—μ„œ crewId μ‚¬μš© 및 GatheringDetail κ΄€λ ¨ 검색:"
rg "crewId.*GatheringDetail" --glob '*.tsx' src/components/

Length of output: 5177

src/app/(crew)/crew/detail/[id]/page.tsx (1)

1-1: API 경둜 λ³€κ²½ 검증이 ν•„μš”ν•©λ‹ˆλ‹€.

API ꡬ쑰 λ³€κ²½μœΌλ‘œ μΈν•œ import 경둜 μˆ˜μ •μ΄ μ˜¬λ°”λ₯΄κ²Œ μ΄λ£¨μ–΄μ‘ŒλŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

βœ… Verification successful

API 경둜 변경이 μ˜¬λ°”λ₯΄κ²Œ μ μš©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new API path exists and is consistently used

# Check if the new API file exists
fd "crew-gathering-list-apis.ts$"

# Check for any remaining old import paths
rg "@/src/_apis/detail/get-gathering-list"

# Check for consistency in new import usage
rg "@/src/_apis/crew/crew-gathering-list-apis"

Length of output: 409

src/_apis/gathering/gathering-detail-apis.ts (1)

1-54: API μ—”λ“œν¬μΈνŠΈ 검증 ν•„μš”

λ°±μ—”λ“œ API λͺ…세와 μΌμΉ˜ν•˜λŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

src/app/(crew)/crew/_components/gathering-detail-modal/container.tsx (2)

3-9: API 톡합이 μ˜¬λ°”λ₯΄κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€!

ν•„μš”ν•œ API ν•¨μˆ˜λ“€κ³Ό μ—λŸ¬ 처리λ₯Ό μœ„ν•œ μ˜μ‘΄μ„±μ΄ 잘 κ΅¬μ„±λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.


19-19: ⚠️ Potential issue

ν…ŒμŠ€νŠΈ 컀버리지 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

토큰 κ΄€λ ¨ 이슈둜 인해 ν…ŒμŠ€νŠΈκ°€ λΆˆκ°€λŠ₯ν•œ μƒν™©μž…λ‹ˆλ‹€. μ΄λŠ” μ½”λ“œμ˜ 신뒰성을 μ €ν•΄ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ ν…ŒμŠ€νŠΈ ν™˜κ²½μ„ ν™•μΈν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€:

src/components/common/gathering-card/container.tsx (1)

5-5: import 경둜 λ³€κ²½ 검증이 ν•„μš”ν•©λ‹ˆλ‹€.

μƒˆλ‘œμš΄ import κ²½λ‘œκ°€ μ˜¬λ°”λ₯΄κ²Œ κ΅¬μ„±λ˜μ–΄ μžˆλŠ”μ§€, 그리고 이 변경사항이 μ½”λ“œλ² μ΄μŠ€ μ „μ²΄μ—μ„œ μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆλŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

βœ… Verification successful

import 경둜 변경이 ν™•μΈλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

λ³€κ²½λœ import κ²½λ‘œκ°€ μ˜¬λ°”λ₯΄λ©°, μ½”λ“œλ² μ΄μŠ€ μ „λ°˜μ— 걸쳐 μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path and its usage across the codebase

# Check if the new path exists
fd "gathering-detail-queries.ts" src/_queries/gathering

# Check for any remaining old import paths
rg "@/src/_queries/detail/gathering-detail-queries"

# Check for consistency of the new import path
rg "@/src/_queries/gathering/gathering-detail-queries"

Length of output: 360

Comment on lines +1 to +2
import { fetchApi } from '@/src/utils/api';
import { GatheringDetailType } from '@/src/types/gathering-data';
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

API μ—λŸ¬ 처리 κ°œμ„  ν•„μš”

fetchApi μœ ν‹Έλ¦¬ν‹°λ₯Ό μ‚¬μš©ν•  λ•Œ λ„€νŠΈμ›Œν¬ 였λ₯˜λ‚˜ μ„œλ²„ 였λ₯˜μ— λŒ€ν•œ μ²˜λ¦¬κ°€ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. 각 API ν•¨μˆ˜μ—μ„œ try-catchλ₯Ό μ‚¬μš©ν•˜μ—¬ μ—λŸ¬λ₯Ό 적절히 μ²˜λ¦¬ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μ—λŸ¬ νƒ€μž…μ„ μ •μ˜ν•˜κ³  μ²˜λ¦¬ν•˜λŠ” 것을 μΆ”μ²œλ“œλ¦½λ‹ˆλ‹€:

interface ApiError {
  message: string;
  status: number;
}

// 각 ν•¨μˆ˜μ—μ„œ μ‚¬μš©ν•  μ—λŸ¬ 처리 μ˜ˆμ‹œ
try {
  const response = await fetchApi<{ data: GatheringDetailType }>(url, options);
  return response.data;
} catch (error) {
  throw new Error(`λͺ¨μž„ 상세 정보λ₯Ό κ°€μ Έμ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€: ${error.message}`);
}

Comment on lines +20 to +54
// NOTE: 약속 μ°Έμ—¬
export async function JoinGathering(crewId: number, gatheringId: number): Promise<void> {
const url = `/api/crews/${crewId}/gatherings/${gatheringId}/join`;

await fetchApi(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
}

// NOTE: 약속 μ·¨μ†Œ(host)
export async function CancelGathering(crewId: number, gatheringId: number): Promise<void> {
const url = `/api/crews/${crewId}/gatherings/${gatheringId}`;

await fetchApi(url, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
});
}

// NOTE: 약속 μ°Έμ—¬ μ·¨μ†Œ(μ°Έμ—¬μž)
export async function LeaveGathering(crewId: number, gatheringId: number): Promise<void> {
const url = `/api/crews/${crewId}/gatherings/${gatheringId}/leave`;

await fetchApi(url, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
});
}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

API ν•¨μˆ˜λ“€μ˜ 일관성 및 μ•ˆμ •μ„± κ°œμ„  ν•„μš”

λͺ¨λ“  API ν•¨μˆ˜λ“€μ—μ„œ λ‹€μŒ 사항듀이 κ°œμ„ λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€:

  1. μž…λ ₯κ°’ μœ νš¨μ„± 검사가 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€
  2. 인증 헀더가 λͺ¨λ“  μš”μ²­μ— ν•„μš”ν•©λ‹ˆλ‹€
  3. 응닡 νƒ€μž…μ΄ λͺ…μ‹œμ μ΄μ§€ μ•ŠμŠ΅λ‹ˆλ‹€

λ‹€μŒκ³Ό 같은 κ°œμ„ μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

// 곡톡 νƒ€μž… μ •μ˜
interface ApiResponse<T> {
  data: T;
  message: string;
  status: number;
}

// μž…λ ₯κ°’ 검증 μœ ν‹Έλ¦¬ν‹°
function validateIds(crewId: number, gatheringId: number) {
  if (!Number.isInteger(crewId) || crewId <= 0) {
    throw new Error('μœ νš¨ν•˜μ§€ μ•Šμ€ 크루 IDμž…λ‹ˆλ‹€');
  }
  if (!Number.isInteger(gatheringId) || gatheringId <= 0) {
    throw new Error('μœ νš¨ν•˜μ§€ μ•Šμ€ λͺ¨μž„ IDμž…λ‹ˆλ‹€');
  }
}

// μ˜ˆμ‹œ ν•¨μˆ˜ κ΅¬ν˜„
export async function JoinGathering(crewId: number, gatheringId: number): Promise<ApiResponse<void>> {
  validateIds(crewId, gatheringId);
  const url = `/api/crews/${crewId}/gatherings/${gatheringId}/join`;

  try {
    return await fetchApi<ApiResponse<void>>(url, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${getToken()}`,
      },
    });
  } catch (error) {
    throw new Error(`λͺ¨μž„ 참여에 μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€: ${error.message}`);
  }
}

Comment on lines +4 to +18
// NOTE: 약속 λ””ν…ŒμΌ 뢈러였기
export async function GetGatheringDetail(
crewId: number,
gatheringId: number,
): Promise<GatheringDetailType> {
const url = `/api/crews/${crewId}/gatherings/${gatheringId}`;

const response = await fetchApi<{ data: GatheringDetailType }>(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
return response.data;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

인증 토큰 헀더 μΆ”κ°€ ν•„μš”

PRμ—μ„œ μ–ΈκΈ‰λœ 둜그인 토큰 λ¬Έμ œμ™€ κ΄€λ ¨ν•˜μ—¬, Authorization 헀더가 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. 인증이 ν•„μš”ν•œ API ν˜ΈμΆœμ—μ„œλŠ” λ°˜λ“œμ‹œ 토큰을 포함해야 ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•΄μ£Όμ„Έμš”:

  const response = await fetchApi<{ data: GatheringDetailType }>(url, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
+     'Authorization': `Bearer ${getToken()}`,
    },
  });

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +30 to +62
const handleJoin = async () => {
try {
await JoinGathering(data.crewId, data.id);
showToast('약속에 μ°Έμ—¬ν–ˆμŠ΅λ‹ˆλ‹€.', 'success');
close();
} catch (error) {
if (error instanceof ApiError) {
showToast(`μ°Έμ—¬ 쀑 μ—λŸ¬ λ°œμƒ: ${error.message}`, 'error');
}
}
};
const handleDelete = () => {
// TODO : λͺ¨μž„ μ‚­μ œν•˜κΈ° API μ—°κ²°
close();

const handleExit = async () => {
try {
await LeaveGathering(data.crewId, data.id);
close();
} catch (error) {
if (error instanceof ApiError) {
showToast(`μ°Έμ—¬ μ·¨μ†Œ 쀑 μ—λŸ¬ λ°œμƒ: ${error.message}`, 'error');
}
}
};

const handleDelete = async () => {
try {
await CancelGathering(data.crewId, data.id);
showToast('약속을 μ‚­μ œν–ˆμŠ΅λ‹ˆλ‹€.', 'success');
close();
} catch (error) {
if (error instanceof ApiError) {
showToast(`약속 μ‚­μ œ 쀑 μ—λŸ¬ λ°œμƒ: ${error.message}`, 'error');
}
}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

API ν•Έλ“€λŸ¬μ˜ 일관성 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

  1. handleExit ν•¨μˆ˜μ— 성곡 λ©”μ‹œμ§€κ°€ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
  2. μ—λŸ¬ μ²˜λ¦¬κ°€ 각 ν•Έλ“€λŸ¬μ—μ„œ 반볡되고 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

   const handleExit = async () => {
     try {
       await LeaveGathering(data.crewId, data.id);
+      showToast('약속 μ°Έμ—¬λ₯Ό μ·¨μ†Œν–ˆμŠ΅λ‹ˆλ‹€.', 'success');
       close();
     } catch (error) {

μ—λŸ¬ 처리λ₯Ό μœ„ν•œ μœ ν‹Έλ¦¬ν‹° ν•¨μˆ˜λ₯Ό μΆ”κ°€ν•˜λ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

const handleApiError = (error: unknown, context: string) => {
  if (error instanceof ApiError) {
    showToast(`${context} 쀑 μ—λŸ¬ λ°œμƒ: ${error.message}`, 'error');
  }
};

이λ₯Ό ν™œμš©ν•˜μ—¬ 각 ν•Έλ“€λŸ¬μ˜ μ—λŸ¬ 처리λ₯Ό λ‹¨μˆœν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

   } catch (error) {
-    if (error instanceof ApiError) {
-      showToast(`약속 μ‚­μ œ 쀑 μ—λŸ¬ λ°œμƒ: ${error.message}`, 'error');
-    }
+    handleApiError(error, '약속 μ‚­μ œ');
   }

Copy link
Contributor

@yulrang yulrang 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
Contributor

@minkyung5x5 minkyung5x5 left a comment

Choose a reason for hiding this comment

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

μˆ˜κ³ ν•˜μ…¨μŠ΅λ‹ˆλ‹·!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

약속 λͺ¨λ‹¬ μ•ˆ api μ—°κ²°

4 participants