Skip to content

Conversation

@modzivv
Copy link
Member

@modzivv modzivv commented Jul 31, 2025

📝 Description

리뷰 및 알림 기능 API에서 BigInt(undefined) 변환으로 인한 서버 500 에러 해결

Fixes #104

Related #12 #30 #39

⚙️ Type

  • 기능 추가 (새로운 API, 서비스 로직 등)
  • 버그 수정 (예외 처리, 동작 오류 등)
  • 리팩토링 (코드 정리, 로직 개선 등)
  • 문서 수정 (README, Swagger, 주석 등)
  • 테스트 코드 추가/수정
  • 의존성 추가/수정

📂 Summary of Changes

  • src/common/errors/notification.errors.js: 에러 코드(N012-N013) 추가
  • src/common/errors/review.errors.js: 에러 코드(R011-R014) 추가
  • src/notification/controller/notification.controller.js, src/notification/fcm/controller/push.controller.js, src/review/controller/review.controller.js: 필수 파라미터 누락 시 커스텀 에러 반환 로직 추가
  • src/review/controller/review.controller.js: req.user.id -> req.user.userId로 수정 및 사용자 ID 접근 방식 통일

👀 To Reviewer

  • JWT 토큰의 페이로드에서 userId 필드를 올바르게 참조하도록 수정했습니다.
  • 기존에는 사용자 ID를 잘못 참조하여(req.user.id) undefined 값이 들어가면서 BigInt(undefined) 에러가 발생하였으나, 이제는 req.user.userId를 사용하여 정상적으로 id값이 전달되도록 개선하였습니다.
  • 또 필수 파라미터(notificationId 등)가 누락될 경우 기존에는 서버에서 500 에러가 발생했으나,
    이제는 명확한 커스텀 에러(NotificationIdRequiredError 등)를 반환하도록 개선했습니다.

✅ PR Checklist

  • 커밋 메시지 컨벤션을 준수했습니다.
  • 코드 컨벤션을 준수했습니다.
  • 기능이 정상 동작하는지 테스트했습니다.
  • Swagger 문서를 최신 상태로 반영했습니다. (필요 시)

@modzivv modzivv self-assigned this Jul 31, 2025
@modzivv modzivv linked an issue Jul 31, 2025 that may be closed by this pull request
@modzivv modzivv added the bug Something isn't working label Jul 31, 2025
Copy link
Collaborator

@bkw535 bkw535 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
Collaborator

@weejee12 weejee12 left a comment

Choose a reason for hiding this comment

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

확인했습니다~

@modzivv modzivv merged commit 684571c into develop Jul 31, 2025
1 check passed
@modzivv modzivv deleted the fix/104-bigint-error branch July 31, 2025 16:36
@modzivv modzivv restored the fix/104-bigint-error branch July 31, 2025 16:40
@modzivv modzivv deleted the fix/104-bigint-error branch July 31, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] BigInt 변환 시 undefined 값으로 인한 서버 오류 발생

4 participants